objc2_metal/generated/
MTLIndirectCommandBuffer.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct MTLIndirectCommandType(pub NSUInteger);
17bitflags::bitflags! {
18 impl MTLIndirectCommandType: NSUInteger {
19 #[doc(alias = "MTLIndirectCommandTypeDraw")]
20 const Draw = 1<<0;
21 #[doc(alias = "MTLIndirectCommandTypeDrawIndexed")]
22 const DrawIndexed = 1<<1;
23 #[doc(alias = "MTLIndirectCommandTypeDrawPatches")]
24 const DrawPatches = 1<<2;
25 #[doc(alias = "MTLIndirectCommandTypeDrawIndexedPatches")]
26 const DrawIndexedPatches = 1<<3;
27 #[doc(alias = "MTLIndirectCommandTypeConcurrentDispatch")]
28 const ConcurrentDispatch = 1<<5;
29 #[doc(alias = "MTLIndirectCommandTypeConcurrentDispatchThreads")]
30 const ConcurrentDispatchThreads = 1<<6;
31 #[doc(alias = "MTLIndirectCommandTypeDrawMeshThreadgroups")]
32 const DrawMeshThreadgroups = 1<<7;
33 #[doc(alias = "MTLIndirectCommandTypeDrawMeshThreads")]
34 const DrawMeshThreads = 1<<8;
35 }
36}
37
38unsafe impl Encode for MTLIndirectCommandType {
39 const ENCODING: Encoding = NSUInteger::ENCODING;
40}
41
42unsafe impl RefEncode for MTLIndirectCommandType {
43 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
44}
45
46#[repr(C)]
50#[derive(Clone, Copy, Debug, PartialEq)]
51pub struct MTLIndirectCommandBufferExecutionRange {
52 pub location: u32,
53 pub length: u32,
54}
55
56unsafe impl Encode for MTLIndirectCommandBufferExecutionRange {
57 const ENCODING: Encoding = Encoding::Struct("?", &[<u32>::ENCODING, <u32>::ENCODING]);
58}
59
60unsafe impl RefEncode for MTLIndirectCommandBufferExecutionRange {
61 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
62}
63
64impl MTLIndirectCommandBufferExecutionRange {
65 }
67
68extern_class!(
69 #[unsafe(super(NSObject))]
73 #[derive(Debug, PartialEq, Eq, Hash)]
74 pub struct MTLIndirectCommandBufferDescriptor;
75);
76
77extern_conformance!(
78 unsafe impl NSCopying for MTLIndirectCommandBufferDescriptor {}
79);
80
81unsafe impl CopyingHelper for MTLIndirectCommandBufferDescriptor {
82 type Result = Self;
83}
84
85extern_conformance!(
86 unsafe impl NSObjectProtocol for MTLIndirectCommandBufferDescriptor {}
87);
88
89impl MTLIndirectCommandBufferDescriptor {
90 extern_methods!(
91 #[unsafe(method(commandTypes))]
95 #[unsafe(method_family = none)]
96 pub fn commandTypes(&self) -> MTLIndirectCommandType;
97
98 #[unsafe(method(setCommandTypes:))]
100 #[unsafe(method_family = none)]
101 pub fn setCommandTypes(&self, command_types: MTLIndirectCommandType);
102
103 #[unsafe(method(inheritPipelineState))]
105 #[unsafe(method_family = none)]
106 pub fn inheritPipelineState(&self) -> bool;
107
108 #[unsafe(method(setInheritPipelineState:))]
110 #[unsafe(method_family = none)]
111 pub fn setInheritPipelineState(&self, inherit_pipeline_state: bool);
112
113 #[unsafe(method(inheritBuffers))]
115 #[unsafe(method_family = none)]
116 pub fn inheritBuffers(&self) -> bool;
117
118 #[unsafe(method(setInheritBuffers:))]
120 #[unsafe(method_family = none)]
121 pub fn setInheritBuffers(&self, inherit_buffers: bool);
122
123 #[unsafe(method(inheritDepthStencilState))]
129 #[unsafe(method_family = none)]
130 pub fn inheritDepthStencilState(&self) -> bool;
131
132 #[unsafe(method(setInheritDepthStencilState:))]
134 #[unsafe(method_family = none)]
135 pub fn setInheritDepthStencilState(&self, inherit_depth_stencil_state: bool);
136
137 #[unsafe(method(inheritDepthBias))]
143 #[unsafe(method_family = none)]
144 pub fn inheritDepthBias(&self) -> bool;
145
146 #[unsafe(method(setInheritDepthBias:))]
148 #[unsafe(method_family = none)]
149 pub fn setInheritDepthBias(&self, inherit_depth_bias: bool);
150
151 #[unsafe(method(inheritDepthClipMode))]
157 #[unsafe(method_family = none)]
158 pub fn inheritDepthClipMode(&self) -> bool;
159
160 #[unsafe(method(setInheritDepthClipMode:))]
162 #[unsafe(method_family = none)]
163 pub fn setInheritDepthClipMode(&self, inherit_depth_clip_mode: bool);
164
165 #[unsafe(method(inheritCullMode))]
171 #[unsafe(method_family = none)]
172 pub fn inheritCullMode(&self) -> bool;
173
174 #[unsafe(method(setInheritCullMode:))]
176 #[unsafe(method_family = none)]
177 pub fn setInheritCullMode(&self, inherit_cull_mode: bool);
178
179 #[unsafe(method(inheritFrontFacingWinding))]
185 #[unsafe(method_family = none)]
186 pub fn inheritFrontFacingWinding(&self) -> bool;
187
188 #[unsafe(method(setInheritFrontFacingWinding:))]
190 #[unsafe(method_family = none)]
191 pub fn setInheritFrontFacingWinding(&self, inherit_front_facing_winding: bool);
192
193 #[unsafe(method(inheritTriangleFillMode))]
199 #[unsafe(method_family = none)]
200 pub fn inheritTriangleFillMode(&self) -> bool;
201
202 #[unsafe(method(setInheritTriangleFillMode:))]
204 #[unsafe(method_family = none)]
205 pub fn setInheritTriangleFillMode(&self, inherit_triangle_fill_mode: bool);
206
207 #[unsafe(method(maxVertexBufferBindCount))]
209 #[unsafe(method_family = none)]
210 pub fn maxVertexBufferBindCount(&self) -> NSUInteger;
211
212 #[unsafe(method(setMaxVertexBufferBindCount:))]
214 #[unsafe(method_family = none)]
215 pub fn setMaxVertexBufferBindCount(&self, max_vertex_buffer_bind_count: NSUInteger);
216
217 #[unsafe(method(maxFragmentBufferBindCount))]
219 #[unsafe(method_family = none)]
220 pub fn maxFragmentBufferBindCount(&self) -> NSUInteger;
221
222 #[unsafe(method(setMaxFragmentBufferBindCount:))]
224 #[unsafe(method_family = none)]
225 pub fn setMaxFragmentBufferBindCount(&self, max_fragment_buffer_bind_count: NSUInteger);
226
227 #[unsafe(method(maxKernelBufferBindCount))]
229 #[unsafe(method_family = none)]
230 pub fn maxKernelBufferBindCount(&self) -> NSUInteger;
231
232 #[unsafe(method(setMaxKernelBufferBindCount:))]
234 #[unsafe(method_family = none)]
235 pub fn setMaxKernelBufferBindCount(&self, max_kernel_buffer_bind_count: NSUInteger);
236
237 #[unsafe(method(maxKernelThreadgroupMemoryBindCount))]
240 #[unsafe(method_family = none)]
241 pub fn maxKernelThreadgroupMemoryBindCount(&self) -> NSUInteger;
242
243 #[unsafe(method(setMaxKernelThreadgroupMemoryBindCount:))]
249 #[unsafe(method_family = none)]
250 pub unsafe fn setMaxKernelThreadgroupMemoryBindCount(
251 &self,
252 max_kernel_threadgroup_memory_bind_count: NSUInteger,
253 );
254
255 #[unsafe(method(maxObjectBufferBindCount))]
257 #[unsafe(method_family = none)]
258 pub fn maxObjectBufferBindCount(&self) -> NSUInteger;
259
260 #[unsafe(method(setMaxObjectBufferBindCount:))]
266 #[unsafe(method_family = none)]
267 pub unsafe fn setMaxObjectBufferBindCount(&self, max_object_buffer_bind_count: NSUInteger);
268
269 #[unsafe(method(maxMeshBufferBindCount))]
271 #[unsafe(method_family = none)]
272 pub fn maxMeshBufferBindCount(&self) -> NSUInteger;
273
274 #[unsafe(method(setMaxMeshBufferBindCount:))]
280 #[unsafe(method_family = none)]
281 pub unsafe fn setMaxMeshBufferBindCount(&self, max_mesh_buffer_bind_count: NSUInteger);
282
283 #[unsafe(method(maxObjectThreadgroupMemoryBindCount))]
286 #[unsafe(method_family = none)]
287 pub fn maxObjectThreadgroupMemoryBindCount(&self) -> NSUInteger;
288
289 #[unsafe(method(setMaxObjectThreadgroupMemoryBindCount:))]
295 #[unsafe(method_family = none)]
296 pub unsafe fn setMaxObjectThreadgroupMemoryBindCount(
297 &self,
298 max_object_threadgroup_memory_bind_count: NSUInteger,
299 );
300
301 #[unsafe(method(supportRayTracing))]
303 #[unsafe(method_family = none)]
304 pub fn supportRayTracing(&self) -> bool;
305
306 #[unsafe(method(setSupportRayTracing:))]
308 #[unsafe(method_family = none)]
309 pub fn setSupportRayTracing(&self, support_ray_tracing: bool);
310
311 #[unsafe(method(supportDynamicAttributeStride))]
317 #[unsafe(method_family = none)]
318 pub fn supportDynamicAttributeStride(&self) -> bool;
319
320 #[unsafe(method(setSupportDynamicAttributeStride:))]
322 #[unsafe(method_family = none)]
323 pub fn setSupportDynamicAttributeStride(&self, support_dynamic_attribute_stride: bool);
324
325 #[unsafe(method(supportColorAttachmentMapping))]
327 #[unsafe(method_family = none)]
328 pub fn supportColorAttachmentMapping(&self) -> bool;
329
330 #[unsafe(method(setSupportColorAttachmentMapping:))]
332 #[unsafe(method_family = none)]
333 pub fn setSupportColorAttachmentMapping(&self, support_color_attachment_mapping: bool);
334 );
335}
336
337impl MTLIndirectCommandBufferDescriptor {
339 extern_methods!(
340 #[unsafe(method(init))]
341 #[unsafe(method_family = init)]
342 pub fn init(this: Allocated<Self>) -> Retained<Self>;
343
344 #[unsafe(method(new))]
345 #[unsafe(method_family = new)]
346 pub fn new() -> Retained<Self>;
347 );
348}
349
350impl DefaultRetained for MTLIndirectCommandBufferDescriptor {
351 #[inline]
352 fn default_retained() -> Retained<Self> {
353 Self::new()
354 }
355}
356
357extern_protocol!(
358 #[cfg(all(feature = "MTLAllocation", feature = "MTLResource"))]
360 pub unsafe trait MTLIndirectCommandBuffer: MTLResource {
361 #[unsafe(method(size))]
362 #[unsafe(method_family = none)]
363 fn size(&self) -> NSUInteger;
364
365 #[cfg(feature = "MTLTypes")]
366 #[unsafe(method(gpuResourceID))]
368 #[unsafe(method_family = none)]
369 fn gpuResourceID(&self) -> MTLResourceID;
370
371 #[unsafe(method(resetWithRange:))]
375 #[unsafe(method_family = none)]
376 unsafe fn resetWithRange(&self, range: NSRange);
377
378 #[cfg(feature = "MTLIndirectCommandEncoder")]
379 #[unsafe(method(indirectRenderCommandAtIndex:))]
383 #[unsafe(method_family = none)]
384 unsafe fn indirectRenderCommandAtIndex(
385 &self,
386 command_index: NSUInteger,
387 ) -> Retained<ProtocolObject<dyn MTLIndirectRenderCommand>>;
388
389 #[cfg(feature = "MTLIndirectCommandEncoder")]
390 #[unsafe(method(indirectComputeCommandAtIndex:))]
394 #[unsafe(method_family = none)]
395 unsafe fn indirectComputeCommandAtIndex(
396 &self,
397 command_index: NSUInteger,
398 ) -> Retained<ProtocolObject<dyn MTLIndirectComputeCommand>>;
399 }
400);