1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
use objc2::{
extern_class, extern_conformance, extern_methods,
rc::{Allocated, Retained},
runtime::NSObject,
};
use objc2_foundation::{CopyingHelper, NSCopying, NSObjectProtocol};
use super::types::MTLIndirectCommandType;
extern_class!(
/// Descriptor specifying limits and features for an indirect command buffer.
///
/// Availability: macOS 10.14+, iOS 12.0+
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MTLIndirectCommandBufferDescriptor;
);
extern_conformance!(
unsafe impl NSCopying for MTLIndirectCommandBufferDescriptor {}
);
unsafe impl CopyingHelper for MTLIndirectCommandBufferDescriptor {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for MTLIndirectCommandBufferDescriptor {}
);
impl MTLIndirectCommandBufferDescriptor {
extern_methods!(
/// Command types that may be encoded.
///
/// Availability: macOS 10.14+, iOS 12.0+
#[unsafe(method(commandTypes))]
#[unsafe(method_family = none)]
pub fn command_types(&self) -> MTLIndirectCommandType;
/// Setter for [`command_types`][Self::command_types].
#[unsafe(method(setCommandTypes:))]
#[unsafe(method_family = none)]
pub fn set_command_types(
&self,
command_types: MTLIndirectCommandType,
);
/// Whether pipelines are inherited from the encoder.
///
/// Availability: macOS 10.14+, iOS 13.0+
#[unsafe(method(inheritPipelineState))]
#[unsafe(method_family = none)]
pub fn inherit_pipeline_state(&self) -> bool;
/// Setter for [`inherit_pipeline_state`][Self::inherit_pipeline_state].
#[unsafe(method(setInheritPipelineState:))]
#[unsafe(method_family = none)]
pub fn set_inherit_pipeline_state(
&self,
inherit_pipeline_state: bool,
);
/// Whether argument buffers are inherited.
#[unsafe(method(inheritBuffers))]
#[unsafe(method_family = none)]
pub fn inherit_buffers(&self) -> bool;
/// Setter for [`inherit_buffers`][Self::inherit_buffers].
#[unsafe(method(setInheritBuffers:))]
#[unsafe(method_family = none)]
pub fn set_inherit_buffers(
&self,
inherit_buffers: bool,
);
/// Whether depth/stencil state is inherited from the encoder.
///
/// Availability: macOS 26.0+, iOS 26.0+
#[unsafe(method(inheritDepthStencilState))]
#[unsafe(method_family = none)]
pub fn inherit_depth_stencil_state(&self) -> bool;
/// Setter for [`inherit_depth_stencil_state`][Self::inherit_depth_stencil_state].
#[unsafe(method(setInheritDepthStencilState:))]
#[unsafe(method_family = none)]
pub fn set_inherit_depth_stencil_state(
&self,
inherit: bool,
);
/// Whether depth bias is inherited from the encoder.
///
/// Availability: macOS 26.0+, iOS 26.0+
#[unsafe(method(inheritDepthBias))]
#[unsafe(method_family = none)]
pub fn inherit_depth_bias(&self) -> bool;
/// Setter for [`inherit_depth_bias`][Self::inherit_depth_bias].
#[unsafe(method(setInheritDepthBias:))]
#[unsafe(method_family = none)]
pub fn set_inherit_depth_bias(
&self,
inherit: bool,
);
/// Whether depth clip mode is inherited from the encoder.
///
/// Availability: macOS 26.0+, iOS 26.0+
#[unsafe(method(inheritDepthClipMode))]
#[unsafe(method_family = none)]
pub fn inherit_depth_clip_mode(&self) -> bool;
/// Setter for [`inherit_depth_clip_mode`][Self::inherit_depth_clip_mode].
#[unsafe(method(setInheritDepthClipMode:))]
#[unsafe(method_family = none)]
pub fn set_inherit_depth_clip_mode(
&self,
inherit: bool,
);
/// Whether cull mode is inherited from the encoder.
///
/// Availability: macOS 26.0+, iOS 26.0+
#[unsafe(method(inheritCullMode))]
#[unsafe(method_family = none)]
pub fn inherit_cull_mode(&self) -> bool;
/// Setter for [`inherit_cull_mode`][Self::inherit_cull_mode].
#[unsafe(method(setInheritCullMode:))]
#[unsafe(method_family = none)]
pub fn set_inherit_cull_mode(
&self,
inherit: bool,
);
/// Whether front-facing winding is inherited from the encoder.
///
/// Availability: macOS 26.0+, iOS 26.0+
#[unsafe(method(inheritFrontFacingWinding))]
#[unsafe(method_family = none)]
pub fn inherit_front_facing_winding(&self) -> bool;
/// Setter for [`inherit_front_facing_winding`][Self::inherit_front_facing_winding].
#[unsafe(method(setInheritFrontFacingWinding:))]
#[unsafe(method_family = none)]
pub fn set_inherit_front_facing_winding(
&self,
inherit: bool,
);
/// Whether triangle fill mode is inherited from the encoder.
///
/// Availability: macOS 26.0+, iOS 26.0+
#[unsafe(method(inheritTriangleFillMode))]
#[unsafe(method_family = none)]
pub fn inherit_triangle_fill_mode(&self) -> bool;
/// Setter for [`inherit_triangle_fill_mode`][Self::inherit_triangle_fill_mode].
#[unsafe(method(setInheritTriangleFillMode:))]
#[unsafe(method_family = none)]
pub fn set_inherit_triangle_fill_mode(
&self,
inherit: bool,
);
/// Maximum vertex buffer bind index per command.
#[unsafe(method(maxVertexBufferBindCount))]
#[unsafe(method_family = none)]
pub fn max_vertex_buffer_bind_count(&self) -> usize;
/// Setter for [`max_vertex_buffer_bind_count`][Self::max_vertex_buffer_bind_count].
#[unsafe(method(setMaxVertexBufferBindCount:))]
#[unsafe(method_family = none)]
pub fn set_max_vertex_buffer_bind_count(
&self,
count: usize,
);
/// Maximum fragment buffer bind index per command.
#[unsafe(method(maxFragmentBufferBindCount))]
#[unsafe(method_family = none)]
pub fn max_fragment_buffer_bind_count(&self) -> usize;
/// Setter for [`max_fragment_buffer_bind_count`][Self::max_fragment_buffer_bind_count].
#[unsafe(method(setMaxFragmentBufferBindCount:))]
#[unsafe(method_family = none)]
pub fn set_max_fragment_buffer_bind_count(
&self,
count: usize,
);
/// Maximum kernel buffer bind index per command.
///
/// Availability: macOS 11.0+, iOS 13.0+
#[unsafe(method(maxKernelBufferBindCount))]
#[unsafe(method_family = none)]
pub fn max_kernel_buffer_bind_count(&self) -> usize;
/// Setter for [`max_kernel_buffer_bind_count`][Self::max_kernel_buffer_bind_count].
#[unsafe(method(setMaxKernelBufferBindCount:))]
#[unsafe(method_family = none)]
pub fn set_max_kernel_buffer_bind_count(
&self,
count: usize,
);
/// Maximum kernel threadgroup memory bind count.
///
/// Availability: macOS 14.0+, iOS 17.0+
#[unsafe(method(maxKernelThreadgroupMemoryBindCount))]
#[unsafe(method_family = none)]
pub fn max_kernel_threadgroup_memory_bind_count(&self) -> usize;
/// Setter for [`max_kernel_threadgroup_memory_bind_count`][Self::max_kernel_threadgroup_memory_bind_count].
#[unsafe(method(setMaxKernelThreadgroupMemoryBindCount:))]
#[unsafe(method_family = none)]
pub fn set_max_kernel_threadgroup_memory_bind_count(
&self,
count: usize,
);
/// Maximum object buffer bind index per render command.
///
/// Availability: macOS 14.0+, iOS 17.0+
#[unsafe(method(maxObjectBufferBindCount))]
#[unsafe(method_family = none)]
pub fn max_object_buffer_bind_count(&self) -> usize;
/// Setter for [`max_object_buffer_bind_count`][Self::max_object_buffer_bind_count].
#[unsafe(method(setMaxObjectBufferBindCount:))]
#[unsafe(method_family = none)]
pub fn set_max_object_buffer_bind_count(
&self,
count: usize,
);
/// Maximum mesh buffer bind index per render command.
///
/// Availability: macOS 14.0+, iOS 17.0+
#[unsafe(method(maxMeshBufferBindCount))]
#[unsafe(method_family = none)]
pub fn max_mesh_buffer_bind_count(&self) -> usize;
/// Setter for [`max_mesh_buffer_bind_count`][Self::max_mesh_buffer_bind_count].
#[unsafe(method(setMaxMeshBufferBindCount:))]
#[unsafe(method_family = none)]
pub fn set_max_mesh_buffer_bind_count(
&self,
count: usize,
);
/// Maximum object threadgroup memory bind count.
///
/// Availability: macOS 14.0+, iOS 17.0+
#[unsafe(method(maxObjectThreadgroupMemoryBindCount))]
#[unsafe(method_family = none)]
pub fn max_object_threadgroup_memory_bind_count(&self) -> usize;
/// Setter for [`max_object_threadgroup_memory_bind_count`][Self::max_object_threadgroup_memory_bind_count].
#[unsafe(method(setMaxObjectThreadgroupMemoryBindCount:))]
#[unsafe(method_family = none)]
pub fn set_max_object_threadgroup_memory_bind_count(
&self,
count: usize,
);
/// Whether render/compute commands can use ray tracing.
///
/// Availability: macOS 13.0+, iOS 16.0+
#[unsafe(method(supportRayTracing))]
#[unsafe(method_family = none)]
pub fn support_ray_tracing(&self) -> bool;
/// Setter for [`support_ray_tracing`][Self::support_ray_tracing].
#[unsafe(method(setSupportRayTracing:))]
#[unsafe(method_family = none)]
pub fn set_support_ray_tracing(
&self,
support: bool,
);
/// Allow setting dynamic attribute stride.
///
/// Availability: macOS 14.0+, iOS 17.0+
#[unsafe(method(supportDynamicAttributeStride))]
#[unsafe(method_family = none)]
pub fn support_dynamic_attribute_stride(&self) -> bool;
/// Setter for [`support_dynamic_attribute_stride`][Self::support_dynamic_attribute_stride].
#[unsafe(method(setSupportDynamicAttributeStride:))]
#[unsafe(method_family = none)]
pub fn set_support_dynamic_attribute_stride(
&self,
support: bool,
);
/// Whether to support color attachment mapping.
///
/// Availability: macOS 26.0+, iOS 26.0+
#[unsafe(method(supportColorAttachmentMapping))]
#[unsafe(method_family = none)]
pub fn support_color_attachment_mapping(&self) -> bool;
/// Setter for [`support_color_attachment_mapping`][Self::support_color_attachment_mapping].
#[unsafe(method(setSupportColorAttachmentMapping:))]
#[unsafe(method_family = none)]
pub fn set_support_color_attachment_mapping(
&self,
support: bool,
);
);
}
/// Methods declared on superclass `NSObject`.
impl MTLIndirectCommandBufferDescriptor {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new() -> Retained<Self>;
);
}