objc2_metal/generated/
MTLAccelerationStructure.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// Controls the acceleration structure refit operation
11///
12/// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlaccelerationstructurerefitoptions?language=objc)
13// NS_OPTIONS
14#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct MTLAccelerationStructureRefitOptions(pub NSUInteger);
17bitflags::bitflags! {
18    impl MTLAccelerationStructureRefitOptions: NSUInteger {
19/// Refitting shall result in updated vertex data from the provided geometry descriptor.
20/// If not set, vertex buffers shall be ignored on the geometry descriptor and vertex data previously
21/// encoded shall be copied.
22        #[doc(alias = "MTLAccelerationStructureRefitOptionVertexData")]
23        const VertexData = 1<<0;
24/// Refitting shall result in updated per primitive data from the provided geometry descriptor.
25/// If not set, per primitive data buffers shall be ignored on the geometry descriptor and per primitive
26/// data previously encoded shall be copied.
27        #[doc(alias = "MTLAccelerationStructureRefitOptionPerPrimitiveData")]
28        const PerPrimitiveData = 1<<1;
29    }
30}
31
32unsafe impl Encode for MTLAccelerationStructureRefitOptions {
33    const ENCODING: Encoding = NSUInteger::ENCODING;
34}
35
36unsafe impl RefEncode for MTLAccelerationStructureRefitOptions {
37    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
38}
39
40/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlaccelerationstructureusage?language=objc)
41// NS_OPTIONS
42#[repr(transparent)]
43#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
44pub struct MTLAccelerationStructureUsage(pub NSUInteger);
45bitflags::bitflags! {
46    impl MTLAccelerationStructureUsage: NSUInteger {
47/// Default usage
48        #[doc(alias = "MTLAccelerationStructureUsageNone")]
49        const None = 0;
50/// Enable refitting for this acceleration structure. Note that this may reduce
51/// acceleration structure quality.
52        #[doc(alias = "MTLAccelerationStructureUsageRefit")]
53        const Refit = 1<<0;
54/// Prefer building this acceleration structure quickly at the cost of reduced ray
55/// tracing performance.
56        #[doc(alias = "MTLAccelerationStructureUsagePreferFastBuild")]
57        const PreferFastBuild = 1<<1;
58/// Enable extended limits for this acceleration structure, possibly at the cost of
59/// reduced ray tracing performance.
60        #[doc(alias = "MTLAccelerationStructureUsageExtendedLimits")]
61        const ExtendedLimits = 1<<2;
62/// Prioritize intersection performance over acceleration structure build time
63        #[doc(alias = "MTLAccelerationStructureUsagePreferFastIntersection")]
64        const PreferFastIntersection = 1<<4;
65/// Minimize the size of the acceleration structure in memory, potentially at
66/// the cost of increased build time or reduced intersection performance.
67        #[doc(alias = "MTLAccelerationStructureUsageMinimizeMemory")]
68        const MinimizeMemory = 1<<5;
69    }
70}
71
72unsafe impl Encode for MTLAccelerationStructureUsage {
73    const ENCODING: Encoding = NSUInteger::ENCODING;
74}
75
76unsafe impl RefEncode for MTLAccelerationStructureUsage {
77    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
78}
79
80/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlaccelerationstructureinstanceoptions?language=objc)
81// NS_OPTIONS
82#[repr(transparent)]
83#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
84pub struct MTLAccelerationStructureInstanceOptions(pub u32);
85bitflags::bitflags! {
86    impl MTLAccelerationStructureInstanceOptions: u32 {
87/// No options
88        #[doc(alias = "MTLAccelerationStructureInstanceOptionNone")]
89        const None = 0;
90/// Disable triangle back or front face culling
91        #[doc(alias = "MTLAccelerationStructureInstanceOptionDisableTriangleCulling")]
92        const DisableTriangleCulling = 1<<0;
93/// Override triangle front-facing winding. By default, the winding is
94/// assumed to be clockwise unless overridden by the intersector object. This overrides
95/// the intersector's winding order.
96        #[doc(alias = "MTLAccelerationStructureInstanceOptionTriangleFrontFacingWindingCounterClockwise")]
97        const TriangleFrontFacingWindingCounterClockwise = 1<<1;
98/// Geometry is opaque
99        #[doc(alias = "MTLAccelerationStructureInstanceOptionOpaque")]
100        const Opaque = 1<<2;
101/// Geometry is non-opaque
102        #[doc(alias = "MTLAccelerationStructureInstanceOptionNonOpaque")]
103        const NonOpaque = 1<<3;
104    }
105}
106
107unsafe impl Encode for MTLAccelerationStructureInstanceOptions {
108    const ENCODING: Encoding = u32::ENCODING;
109}
110
111unsafe impl RefEncode for MTLAccelerationStructureInstanceOptions {
112    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
113}
114
115/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlmatrixlayout?language=objc)
116// NS_ENUM
117#[repr(transparent)]
118#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
119pub struct MTLMatrixLayout(pub NSInteger);
120impl MTLMatrixLayout {
121    /// Column-major order
122    #[doc(alias = "MTLMatrixLayoutColumnMajor")]
123    pub const ColumnMajor: Self = Self(0);
124    /// Row-major order
125    #[doc(alias = "MTLMatrixLayoutRowMajor")]
126    pub const RowMajor: Self = Self(1);
127}
128
129unsafe impl Encode for MTLMatrixLayout {
130    const ENCODING: Encoding = NSInteger::ENCODING;
131}
132
133unsafe impl RefEncode for MTLMatrixLayout {
134    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
135}
136
137extern_class!(
138    /// Base class for acceleration structure descriptors. Do not use this class directly. Use
139    /// one of the derived classes instead.
140    ///
141    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlaccelerationstructuredescriptor?language=objc)
142    #[unsafe(super(NSObject))]
143    #[derive(Debug, PartialEq, Eq, Hash)]
144    pub struct MTLAccelerationStructureDescriptor;
145);
146
147extern_conformance!(
148    unsafe impl NSCopying for MTLAccelerationStructureDescriptor {}
149);
150
151unsafe impl CopyingHelper for MTLAccelerationStructureDescriptor {
152    type Result = Self;
153}
154
155extern_conformance!(
156    unsafe impl NSObjectProtocol for MTLAccelerationStructureDescriptor {}
157);
158
159impl MTLAccelerationStructureDescriptor {
160    extern_methods!(
161        #[unsafe(method(usage))]
162        #[unsafe(method_family = none)]
163        pub fn usage(&self) -> MTLAccelerationStructureUsage;
164
165        /// Setter for [`usage`][Self::usage].
166        #[unsafe(method(setUsage:))]
167        #[unsafe(method_family = none)]
168        pub fn setUsage(&self, usage: MTLAccelerationStructureUsage);
169    );
170}
171
172/// Methods declared on superclass `NSObject`.
173impl MTLAccelerationStructureDescriptor {
174    extern_methods!(
175        #[unsafe(method(init))]
176        #[unsafe(method_family = init)]
177        pub fn init(this: Allocated<Self>) -> Retained<Self>;
178
179        #[unsafe(method(new))]
180        #[unsafe(method_family = new)]
181        pub fn new() -> Retained<Self>;
182    );
183}
184
185impl DefaultRetained for MTLAccelerationStructureDescriptor {
186    #[inline]
187    fn default_retained() -> Retained<Self> {
188        Self::new()
189    }
190}
191
192extern_class!(
193    /// Base class for all geometry descriptors. Do not use this class directly. Use one of the derived
194    /// classes instead.
195    ///
196    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlaccelerationstructuregeometrydescriptor?language=objc)
197    #[unsafe(super(NSObject))]
198    #[derive(Debug, PartialEq, Eq, Hash)]
199    pub struct MTLAccelerationStructureGeometryDescriptor;
200);
201
202extern_conformance!(
203    unsafe impl NSCopying for MTLAccelerationStructureGeometryDescriptor {}
204);
205
206unsafe impl CopyingHelper for MTLAccelerationStructureGeometryDescriptor {
207    type Result = Self;
208}
209
210extern_conformance!(
211    unsafe impl NSObjectProtocol for MTLAccelerationStructureGeometryDescriptor {}
212);
213
214impl MTLAccelerationStructureGeometryDescriptor {
215    extern_methods!(
216        #[unsafe(method(intersectionFunctionTableOffset))]
217        #[unsafe(method_family = none)]
218        pub fn intersectionFunctionTableOffset(&self) -> NSUInteger;
219
220        /// Setter for [`intersectionFunctionTableOffset`][Self::intersectionFunctionTableOffset].
221        #[unsafe(method(setIntersectionFunctionTableOffset:))]
222        #[unsafe(method_family = none)]
223        pub fn setIntersectionFunctionTableOffset(
224            &self,
225            intersection_function_table_offset: NSUInteger,
226        );
227
228        /// Whether the geometry is opaque
229        #[unsafe(method(opaque))]
230        #[unsafe(method_family = none)]
231        pub fn opaque(&self) -> bool;
232
233        /// Setter for [`opaque`][Self::opaque].
234        #[unsafe(method(setOpaque:))]
235        #[unsafe(method_family = none)]
236        pub fn setOpaque(&self, opaque: bool);
237
238        /// Whether intersection functions may be invoked more than once per ray/primitive
239        /// intersection. Defaults to YES.
240        #[unsafe(method(allowDuplicateIntersectionFunctionInvocation))]
241        #[unsafe(method_family = none)]
242        pub fn allowDuplicateIntersectionFunctionInvocation(&self) -> bool;
243
244        /// Setter for [`allowDuplicateIntersectionFunctionInvocation`][Self::allowDuplicateIntersectionFunctionInvocation].
245        #[unsafe(method(setAllowDuplicateIntersectionFunctionInvocation:))]
246        #[unsafe(method_family = none)]
247        pub fn setAllowDuplicateIntersectionFunctionInvocation(
248            &self,
249            allow_duplicate_intersection_function_invocation: bool,
250        );
251
252        /// Label
253        #[unsafe(method(label))]
254        #[unsafe(method_family = none)]
255        pub fn label(&self) -> Option<Retained<NSString>>;
256
257        /// Setter for [`label`][Self::label].
258        ///
259        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
260        #[unsafe(method(setLabel:))]
261        #[unsafe(method_family = none)]
262        pub fn setLabel(&self, label: Option<&NSString>);
263
264        #[cfg(all(
265            feature = "MTLAllocation",
266            feature = "MTLBuffer",
267            feature = "MTLResource"
268        ))]
269        /// Data buffer containing per-primitive data. May be nil.
270        #[unsafe(method(primitiveDataBuffer))]
271        #[unsafe(method_family = none)]
272        pub fn primitiveDataBuffer(&self) -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
273
274        #[cfg(all(
275            feature = "MTLAllocation",
276            feature = "MTLBuffer",
277            feature = "MTLResource"
278        ))]
279        /// Setter for [`primitiveDataBuffer`][Self::primitiveDataBuffer].
280        #[unsafe(method(setPrimitiveDataBuffer:))]
281        #[unsafe(method_family = none)]
282        pub fn setPrimitiveDataBuffer(
283            &self,
284            primitive_data_buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
285        );
286
287        /// Primitive data buffer offset in bytes. Must be aligned to the platform's buffer offset alignment. Defaults to 0 bytes.
288        #[unsafe(method(primitiveDataBufferOffset))]
289        #[unsafe(method_family = none)]
290        pub fn primitiveDataBufferOffset(&self) -> NSUInteger;
291
292        /// Setter for [`primitiveDataBufferOffset`][Self::primitiveDataBufferOffset].
293        ///
294        /// # Safety
295        ///
296        /// This might not be bounds-checked.
297        #[unsafe(method(setPrimitiveDataBufferOffset:))]
298        #[unsafe(method_family = none)]
299        pub unsafe fn setPrimitiveDataBufferOffset(&self, primitive_data_buffer_offset: NSUInteger);
300
301        /// Stride, in bytes, between per-primitive data in the primitive data buffer. Must be at least primitiveDataElementSize and must be a
302        /// multiple of 4 bytes. Defaults to 0 bytes. Assumed to be equal to primitiveDataElementSize if zero.
303        #[unsafe(method(primitiveDataStride))]
304        #[unsafe(method_family = none)]
305        pub fn primitiveDataStride(&self) -> NSUInteger;
306
307        /// Setter for [`primitiveDataStride`][Self::primitiveDataStride].
308        #[unsafe(method(setPrimitiveDataStride:))]
309        #[unsafe(method_family = none)]
310        pub fn setPrimitiveDataStride(&self, primitive_data_stride: NSUInteger);
311
312        /// Size, in bytes, of the data for each primitive in the primitive data buffer. Must be at most primitiveDataStride and must be a
313        /// multiple of 4 bytes. Defaults to 0 bytes.
314        #[unsafe(method(primitiveDataElementSize))]
315        #[unsafe(method_family = none)]
316        pub fn primitiveDataElementSize(&self) -> NSUInteger;
317
318        /// Setter for [`primitiveDataElementSize`][Self::primitiveDataElementSize].
319        #[unsafe(method(setPrimitiveDataElementSize:))]
320        #[unsafe(method_family = none)]
321        pub fn setPrimitiveDataElementSize(&self, primitive_data_element_size: NSUInteger);
322    );
323}
324
325/// Methods declared on superclass `NSObject`.
326impl MTLAccelerationStructureGeometryDescriptor {
327    extern_methods!(
328        #[unsafe(method(init))]
329        #[unsafe(method_family = init)]
330        pub fn init(this: Allocated<Self>) -> Retained<Self>;
331
332        #[unsafe(method(new))]
333        #[unsafe(method_family = new)]
334        pub fn new() -> Retained<Self>;
335    );
336}
337
338impl DefaultRetained for MTLAccelerationStructureGeometryDescriptor {
339    #[inline]
340    fn default_retained() -> Retained<Self> {
341        Self::new()
342    }
343}
344
345/// Describes what happens to the object before the first motion key and after the last
346/// motion key.
347///
348/// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlmotionbordermode?language=objc)
349// NS_ENUM
350#[repr(transparent)]
351#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
352pub struct MTLMotionBorderMode(pub u32);
353impl MTLMotionBorderMode {
354    /// Motion is stopped. (default)
355    #[doc(alias = "MTLMotionBorderModeClamp")]
356    pub const Clamp: Self = Self(0);
357    /// Object disappears
358    #[doc(alias = "MTLMotionBorderModeVanish")]
359    pub const Vanish: Self = Self(1);
360}
361
362unsafe impl Encode for MTLMotionBorderMode {
363    const ENCODING: Encoding = u32::ENCODING;
364}
365
366unsafe impl RefEncode for MTLMotionBorderMode {
367    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
368}
369
370extern_class!(
371    /// Descriptor for a primitive acceleration structure
372    ///
373    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlprimitiveaccelerationstructuredescriptor?language=objc)
374    #[unsafe(super(MTLAccelerationStructureDescriptor, NSObject))]
375    #[derive(Debug, PartialEq, Eq, Hash)]
376    pub struct MTLPrimitiveAccelerationStructureDescriptor;
377);
378
379extern_conformance!(
380    unsafe impl NSCopying for MTLPrimitiveAccelerationStructureDescriptor {}
381);
382
383unsafe impl CopyingHelper for MTLPrimitiveAccelerationStructureDescriptor {
384    type Result = Self;
385}
386
387extern_conformance!(
388    unsafe impl NSObjectProtocol for MTLPrimitiveAccelerationStructureDescriptor {}
389);
390
391impl MTLPrimitiveAccelerationStructureDescriptor {
392    extern_methods!(
393        /// Array of geometry descriptors. If motionKeyframeCount is greater than one all geometryDescriptors
394        /// must be motion versions and have motionKeyframeCount of primitive buffers.
395        #[unsafe(method(geometryDescriptors))]
396        #[unsafe(method_family = none)]
397        pub fn geometryDescriptors(
398            &self,
399        ) -> Option<Retained<NSArray<MTLAccelerationStructureGeometryDescriptor>>>;
400
401        /// Setter for [`geometryDescriptors`][Self::geometryDescriptors].
402        #[unsafe(method(setGeometryDescriptors:))]
403        #[unsafe(method_family = none)]
404        pub fn setGeometryDescriptors(
405            &self,
406            geometry_descriptors: Option<&NSArray<MTLAccelerationStructureGeometryDescriptor>>,
407        );
408
409        /// Motion border mode describing what happens if acceleration structure is sampled before
410        /// motionStartTime. If not set defaults to MTLMotionBorderModeClamp.
411        #[unsafe(method(motionStartBorderMode))]
412        #[unsafe(method_family = none)]
413        pub fn motionStartBorderMode(&self) -> MTLMotionBorderMode;
414
415        /// Setter for [`motionStartBorderMode`][Self::motionStartBorderMode].
416        #[unsafe(method(setMotionStartBorderMode:))]
417        #[unsafe(method_family = none)]
418        pub fn setMotionStartBorderMode(&self, motion_start_border_mode: MTLMotionBorderMode);
419
420        /// Motion border mode describing what happens if acceleration structure is sampled after
421        /// motionEndTime. If not set defaults to MTLMotionBorderModeClamp.
422        #[unsafe(method(motionEndBorderMode))]
423        #[unsafe(method_family = none)]
424        pub fn motionEndBorderMode(&self) -> MTLMotionBorderMode;
425
426        /// Setter for [`motionEndBorderMode`][Self::motionEndBorderMode].
427        #[unsafe(method(setMotionEndBorderMode:))]
428        #[unsafe(method_family = none)]
429        pub fn setMotionEndBorderMode(&self, motion_end_border_mode: MTLMotionBorderMode);
430
431        /// Motion start time of this geometry. If not set defaults to 0.0f.
432        #[unsafe(method(motionStartTime))]
433        #[unsafe(method_family = none)]
434        pub fn motionStartTime(&self) -> c_float;
435
436        /// Setter for [`motionStartTime`][Self::motionStartTime].
437        #[unsafe(method(setMotionStartTime:))]
438        #[unsafe(method_family = none)]
439        pub fn setMotionStartTime(&self, motion_start_time: c_float);
440
441        /// Motion end time of this geometry. If not set defaults to 1.0f.
442        #[unsafe(method(motionEndTime))]
443        #[unsafe(method_family = none)]
444        pub fn motionEndTime(&self) -> c_float;
445
446        /// Setter for [`motionEndTime`][Self::motionEndTime].
447        #[unsafe(method(setMotionEndTime:))]
448        #[unsafe(method_family = none)]
449        pub fn setMotionEndTime(&self, motion_end_time: c_float);
450
451        /// Motion keyframe count. Is 1 by default which means no motion.
452        #[unsafe(method(motionKeyframeCount))]
453        #[unsafe(method_family = none)]
454        pub fn motionKeyframeCount(&self) -> NSUInteger;
455
456        /// Setter for [`motionKeyframeCount`][Self::motionKeyframeCount].
457        ///
458        /// # Safety
459        ///
460        /// This might not be bounds-checked.
461        #[unsafe(method(setMotionKeyframeCount:))]
462        #[unsafe(method_family = none)]
463        pub unsafe fn setMotionKeyframeCount(&self, motion_keyframe_count: NSUInteger);
464
465        #[unsafe(method(descriptor))]
466        #[unsafe(method_family = none)]
467        pub fn descriptor() -> Retained<Self>;
468    );
469}
470
471/// Methods declared on superclass `NSObject`.
472impl MTLPrimitiveAccelerationStructureDescriptor {
473    extern_methods!(
474        #[unsafe(method(init))]
475        #[unsafe(method_family = init)]
476        pub fn init(this: Allocated<Self>) -> Retained<Self>;
477
478        #[unsafe(method(new))]
479        #[unsafe(method_family = new)]
480        pub fn new() -> Retained<Self>;
481    );
482}
483
484impl DefaultRetained for MTLPrimitiveAccelerationStructureDescriptor {
485    #[inline]
486    fn default_retained() -> Retained<Self> {
487        Self::new()
488    }
489}
490
491extern_class!(
492    /// Descriptor for triangle geometry
493    ///
494    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlaccelerationstructuretrianglegeometrydescriptor?language=objc)
495    #[unsafe(super(MTLAccelerationStructureGeometryDescriptor, NSObject))]
496    #[derive(Debug, PartialEq, Eq, Hash)]
497    pub struct MTLAccelerationStructureTriangleGeometryDescriptor;
498);
499
500extern_conformance!(
501    unsafe impl NSCopying for MTLAccelerationStructureTriangleGeometryDescriptor {}
502);
503
504unsafe impl CopyingHelper for MTLAccelerationStructureTriangleGeometryDescriptor {
505    type Result = Self;
506}
507
508extern_conformance!(
509    unsafe impl NSObjectProtocol for MTLAccelerationStructureTriangleGeometryDescriptor {}
510);
511
512impl MTLAccelerationStructureTriangleGeometryDescriptor {
513    extern_methods!(
514        #[cfg(all(
515            feature = "MTLAllocation",
516            feature = "MTLBuffer",
517            feature = "MTLResource"
518        ))]
519        /// Vertex buffer containing triangle vertices. Each vertex position must be formatted
520        /// according to the vertex format. Must not be nil.
521        #[unsafe(method(vertexBuffer))]
522        #[unsafe(method_family = none)]
523        pub fn vertexBuffer(&self) -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
524
525        #[cfg(all(
526            feature = "MTLAllocation",
527            feature = "MTLBuffer",
528            feature = "MTLResource"
529        ))]
530        /// Setter for [`vertexBuffer`][Self::vertexBuffer].
531        #[unsafe(method(setVertexBuffer:))]
532        #[unsafe(method_family = none)]
533        pub fn setVertexBuffer(&self, vertex_buffer: Option<&ProtocolObject<dyn MTLBuffer>>);
534
535        /// Vertex buffer offset. Must be a multiple of the vertex stride and must be aligned to the
536        /// platform's buffer offset alignment.
537        #[unsafe(method(vertexBufferOffset))]
538        #[unsafe(method_family = none)]
539        pub fn vertexBufferOffset(&self) -> NSUInteger;
540
541        /// Setter for [`vertexBufferOffset`][Self::vertexBufferOffset].
542        ///
543        /// # Safety
544        ///
545        /// This might not be bounds-checked.
546        #[unsafe(method(setVertexBufferOffset:))]
547        #[unsafe(method_family = none)]
548        pub unsafe fn setVertexBufferOffset(&self, vertex_buffer_offset: NSUInteger);
549
550        #[cfg(feature = "MTLStageInputOutputDescriptor")]
551        /// Format type of the vertex buffer.
552        /// Defaults to MTLAttributeFormatFloat3 (packed).
553        #[unsafe(method(vertexFormat))]
554        #[unsafe(method_family = none)]
555        pub fn vertexFormat(&self) -> MTLAttributeFormat;
556
557        #[cfg(feature = "MTLStageInputOutputDescriptor")]
558        /// Setter for [`vertexFormat`][Self::vertexFormat].
559        #[unsafe(method(setVertexFormat:))]
560        #[unsafe(method_family = none)]
561        pub fn setVertexFormat(&self, vertex_format: MTLAttributeFormat);
562
563        /// Stride, in bytes, between vertices in the vertex buffer. Must be a multiple of the vertex format data type size and must be aligned to
564        /// the vertex format data type's alignment. Defaults to 0, which will result in a stride of the vertex format data size.
565        #[unsafe(method(vertexStride))]
566        #[unsafe(method_family = none)]
567        pub fn vertexStride(&self) -> NSUInteger;
568
569        /// Setter for [`vertexStride`][Self::vertexStride].
570        #[unsafe(method(setVertexStride:))]
571        #[unsafe(method_family = none)]
572        pub fn setVertexStride(&self, vertex_stride: NSUInteger);
573
574        #[cfg(all(
575            feature = "MTLAllocation",
576            feature = "MTLBuffer",
577            feature = "MTLResource"
578        ))]
579        /// Optional index buffer containing references to vertices in the vertex buffer. May be nil.
580        #[unsafe(method(indexBuffer))]
581        #[unsafe(method_family = none)]
582        pub fn indexBuffer(&self) -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
583
584        #[cfg(all(
585            feature = "MTLAllocation",
586            feature = "MTLBuffer",
587            feature = "MTLResource"
588        ))]
589        /// Setter for [`indexBuffer`][Self::indexBuffer].
590        #[unsafe(method(setIndexBuffer:))]
591        #[unsafe(method_family = none)]
592        pub fn setIndexBuffer(&self, index_buffer: Option<&ProtocolObject<dyn MTLBuffer>>);
593
594        /// Index buffer offset. Must be a multiple of the index data type size and must be aligned to both
595        /// the index data type's alignment and the platform's buffer offset alignment.
596        #[unsafe(method(indexBufferOffset))]
597        #[unsafe(method_family = none)]
598        pub fn indexBufferOffset(&self) -> NSUInteger;
599
600        /// Setter for [`indexBufferOffset`][Self::indexBufferOffset].
601        ///
602        /// # Safety
603        ///
604        /// This might not be bounds-checked.
605        #[unsafe(method(setIndexBufferOffset:))]
606        #[unsafe(method_family = none)]
607        pub unsafe fn setIndexBufferOffset(&self, index_buffer_offset: NSUInteger);
608
609        #[cfg(feature = "MTLArgument")]
610        /// Index type
611        #[unsafe(method(indexType))]
612        #[unsafe(method_family = none)]
613        pub fn indexType(&self) -> MTLIndexType;
614
615        #[cfg(feature = "MTLArgument")]
616        /// Setter for [`indexType`][Self::indexType].
617        #[unsafe(method(setIndexType:))]
618        #[unsafe(method_family = none)]
619        pub fn setIndexType(&self, index_type: MTLIndexType);
620
621        /// Number of triangles
622        #[unsafe(method(triangleCount))]
623        #[unsafe(method_family = none)]
624        pub fn triangleCount(&self) -> NSUInteger;
625
626        /// Setter for [`triangleCount`][Self::triangleCount].
627        #[unsafe(method(setTriangleCount:))]
628        #[unsafe(method_family = none)]
629        pub fn setTriangleCount(&self, triangle_count: NSUInteger);
630
631        #[cfg(all(
632            feature = "MTLAllocation",
633            feature = "MTLBuffer",
634            feature = "MTLResource"
635        ))]
636        /// Buffer containing packed float4x3 transformation matrix. Transform is applied to the vertex data when building the acceleration structure. Input vertex buffers are not modified.
637        /// When set to nil, transformation matrix is not applied to vertex data.
638        #[unsafe(method(transformationMatrixBuffer))]
639        #[unsafe(method_family = none)]
640        pub fn transformationMatrixBuffer(&self)
641            -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
642
643        #[cfg(all(
644            feature = "MTLAllocation",
645            feature = "MTLBuffer",
646            feature = "MTLResource"
647        ))]
648        /// Setter for [`transformationMatrixBuffer`][Self::transformationMatrixBuffer].
649        ///
650        /// # Safety
651        ///
652        /// - `transformation_matrix_buffer` may need to be synchronized.
653        /// - `transformation_matrix_buffer` may be unretained, you must ensure it is kept alive while in use.
654        /// - `transformation_matrix_buffer` contents should be of the correct type.
655        #[unsafe(method(setTransformationMatrixBuffer:))]
656        #[unsafe(method_family = none)]
657        pub unsafe fn setTransformationMatrixBuffer(
658            &self,
659            transformation_matrix_buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
660        );
661
662        /// Transformation matrix buffer offset. Must be a multiple of 4 bytes. Defaults to 0.
663        #[unsafe(method(transformationMatrixBufferOffset))]
664        #[unsafe(method_family = none)]
665        pub fn transformationMatrixBufferOffset(&self) -> NSUInteger;
666
667        /// Setter for [`transformationMatrixBufferOffset`][Self::transformationMatrixBufferOffset].
668        ///
669        /// # Safety
670        ///
671        /// This might not be bounds-checked.
672        #[unsafe(method(setTransformationMatrixBufferOffset:))]
673        #[unsafe(method_family = none)]
674        pub unsafe fn setTransformationMatrixBufferOffset(
675            &self,
676            transformation_matrix_buffer_offset: NSUInteger,
677        );
678
679        /// Matrix layout for the transformation matrix in the transformation
680        /// matrix buffer. Defaults to MTLMatrixLayoutColumnMajor.
681        #[unsafe(method(transformationMatrixLayout))]
682        #[unsafe(method_family = none)]
683        pub fn transformationMatrixLayout(&self) -> MTLMatrixLayout;
684
685        /// Setter for [`transformationMatrixLayout`][Self::transformationMatrixLayout].
686        #[unsafe(method(setTransformationMatrixLayout:))]
687        #[unsafe(method_family = none)]
688        pub fn setTransformationMatrixLayout(&self, transformation_matrix_layout: MTLMatrixLayout);
689
690        #[unsafe(method(descriptor))]
691        #[unsafe(method_family = none)]
692        pub fn descriptor() -> Retained<Self>;
693    );
694}
695
696/// Methods declared on superclass `NSObject`.
697impl MTLAccelerationStructureTriangleGeometryDescriptor {
698    extern_methods!(
699        #[unsafe(method(init))]
700        #[unsafe(method_family = init)]
701        pub fn init(this: Allocated<Self>) -> Retained<Self>;
702
703        #[unsafe(method(new))]
704        #[unsafe(method_family = new)]
705        pub fn new() -> Retained<Self>;
706    );
707}
708
709impl DefaultRetained for MTLAccelerationStructureTriangleGeometryDescriptor {
710    #[inline]
711    fn default_retained() -> Retained<Self> {
712        Self::new()
713    }
714}
715
716extern_class!(
717    /// Descriptor for bounding box geometry
718    ///
719    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlaccelerationstructureboundingboxgeometrydescriptor?language=objc)
720    #[unsafe(super(MTLAccelerationStructureGeometryDescriptor, NSObject))]
721    #[derive(Debug, PartialEq, Eq, Hash)]
722    pub struct MTLAccelerationStructureBoundingBoxGeometryDescriptor;
723);
724
725extern_conformance!(
726    unsafe impl NSCopying for MTLAccelerationStructureBoundingBoxGeometryDescriptor {}
727);
728
729unsafe impl CopyingHelper for MTLAccelerationStructureBoundingBoxGeometryDescriptor {
730    type Result = Self;
731}
732
733extern_conformance!(
734    unsafe impl NSObjectProtocol for MTLAccelerationStructureBoundingBoxGeometryDescriptor {}
735);
736
737impl MTLAccelerationStructureBoundingBoxGeometryDescriptor {
738    extern_methods!(
739        #[cfg(all(
740            feature = "MTLAllocation",
741            feature = "MTLBuffer",
742            feature = "MTLResource"
743        ))]
744        /// Bounding box buffer containing MTLAxisAlignedBoundingBoxes. Must not be nil.
745        #[unsafe(method(boundingBoxBuffer))]
746        #[unsafe(method_family = none)]
747        pub fn boundingBoxBuffer(&self) -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
748
749        #[cfg(all(
750            feature = "MTLAllocation",
751            feature = "MTLBuffer",
752            feature = "MTLResource"
753        ))]
754        /// Setter for [`boundingBoxBuffer`][Self::boundingBoxBuffer].
755        #[unsafe(method(setBoundingBoxBuffer:))]
756        #[unsafe(method_family = none)]
757        pub fn setBoundingBoxBuffer(
758            &self,
759            bounding_box_buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
760        );
761
762        /// Bounding box buffer offset. Must be a multiple of the bounding box stride and must be
763        /// aligned to the platform's buffer offset alignment.
764        #[unsafe(method(boundingBoxBufferOffset))]
765        #[unsafe(method_family = none)]
766        pub fn boundingBoxBufferOffset(&self) -> NSUInteger;
767
768        /// Setter for [`boundingBoxBufferOffset`][Self::boundingBoxBufferOffset].
769        ///
770        /// # Safety
771        ///
772        /// This might not be bounds-checked.
773        #[unsafe(method(setBoundingBoxBufferOffset:))]
774        #[unsafe(method_family = none)]
775        pub unsafe fn setBoundingBoxBufferOffset(&self, bounding_box_buffer_offset: NSUInteger);
776
777        /// Stride, in bytes, between bounding boxes in the bounding box buffer. Must be at least 24
778        /// bytes and must be a multiple of 4 bytes. Defaults to 24 bytes.
779        #[unsafe(method(boundingBoxStride))]
780        #[unsafe(method_family = none)]
781        pub fn boundingBoxStride(&self) -> NSUInteger;
782
783        /// Setter for [`boundingBoxStride`][Self::boundingBoxStride].
784        ///
785        /// # Safety
786        ///
787        /// This might not be bounds-checked.
788        #[unsafe(method(setBoundingBoxStride:))]
789        #[unsafe(method_family = none)]
790        pub unsafe fn setBoundingBoxStride(&self, bounding_box_stride: NSUInteger);
791
792        /// Number of bounding boxes
793        #[unsafe(method(boundingBoxCount))]
794        #[unsafe(method_family = none)]
795        pub fn boundingBoxCount(&self) -> NSUInteger;
796
797        /// Setter for [`boundingBoxCount`][Self::boundingBoxCount].
798        #[unsafe(method(setBoundingBoxCount:))]
799        #[unsafe(method_family = none)]
800        pub fn setBoundingBoxCount(&self, bounding_box_count: NSUInteger);
801
802        #[unsafe(method(descriptor))]
803        #[unsafe(method_family = none)]
804        pub fn descriptor() -> Retained<Self>;
805    );
806}
807
808/// Methods declared on superclass `NSObject`.
809impl MTLAccelerationStructureBoundingBoxGeometryDescriptor {
810    extern_methods!(
811        #[unsafe(method(init))]
812        #[unsafe(method_family = init)]
813        pub fn init(this: Allocated<Self>) -> Retained<Self>;
814
815        #[unsafe(method(new))]
816        #[unsafe(method_family = new)]
817        pub fn new() -> Retained<Self>;
818    );
819}
820
821impl DefaultRetained for MTLAccelerationStructureBoundingBoxGeometryDescriptor {
822    #[inline]
823    fn default_retained() -> Retained<Self> {
824        Self::new()
825    }
826}
827
828extern_class!(
829    /// MTLbuffer and description how the data is stored in it.
830    ///
831    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlmotionkeyframedata?language=objc)
832    #[unsafe(super(NSObject))]
833    #[derive(Debug, PartialEq, Eq, Hash)]
834    pub struct MTLMotionKeyframeData;
835);
836
837extern_conformance!(
838    unsafe impl NSObjectProtocol for MTLMotionKeyframeData {}
839);
840
841impl MTLMotionKeyframeData {
842    extern_methods!(
843        #[cfg(all(
844            feature = "MTLAllocation",
845            feature = "MTLBuffer",
846            feature = "MTLResource"
847        ))]
848        /// Buffer containing the data of a single keyframe. Multiple keyframes can be interleaved in one MTLBuffer.
849        #[unsafe(method(buffer))]
850        #[unsafe(method_family = none)]
851        pub fn buffer(&self) -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
852
853        #[cfg(all(
854            feature = "MTLAllocation",
855            feature = "MTLBuffer",
856            feature = "MTLResource"
857        ))]
858        /// Setter for [`buffer`][Self::buffer].
859        ///
860        /// # Safety
861        ///
862        /// - `buffer` may need to be synchronized.
863        /// - `buffer` may be unretained, you must ensure it is kept alive while in use.
864        /// - `buffer` contents should be of the correct type.
865        #[unsafe(method(setBuffer:))]
866        #[unsafe(method_family = none)]
867        pub unsafe fn setBuffer(&self, buffer: Option<&ProtocolObject<dyn MTLBuffer>>);
868
869        /// Buffer offset. Must be a multiple of 4 bytes.
870        #[unsafe(method(offset))]
871        #[unsafe(method_family = none)]
872        pub fn offset(&self) -> NSUInteger;
873
874        /// Setter for [`offset`][Self::offset].
875        ///
876        /// # Safety
877        ///
878        /// This might not be bounds-checked.
879        #[unsafe(method(setOffset:))]
880        #[unsafe(method_family = none)]
881        pub unsafe fn setOffset(&self, offset: NSUInteger);
882
883        #[unsafe(method(data))]
884        #[unsafe(method_family = none)]
885        pub fn data() -> Retained<Self>;
886    );
887}
888
889/// Methods declared on superclass `NSObject`.
890impl MTLMotionKeyframeData {
891    extern_methods!(
892        #[unsafe(method(init))]
893        #[unsafe(method_family = init)]
894        pub fn init(this: Allocated<Self>) -> Retained<Self>;
895
896        #[unsafe(method(new))]
897        #[unsafe(method_family = new)]
898        pub fn new() -> Retained<Self>;
899    );
900}
901
902impl DefaultRetained for MTLMotionKeyframeData {
903    #[inline]
904    fn default_retained() -> Retained<Self> {
905        Self::new()
906    }
907}
908
909extern_class!(
910    /// Descriptor for motion triangle geometry
911    ///
912    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlaccelerationstructuremotiontrianglegeometrydescriptor?language=objc)
913    #[unsafe(super(MTLAccelerationStructureGeometryDescriptor, NSObject))]
914    #[derive(Debug, PartialEq, Eq, Hash)]
915    pub struct MTLAccelerationStructureMotionTriangleGeometryDescriptor;
916);
917
918extern_conformance!(
919    unsafe impl NSCopying for MTLAccelerationStructureMotionTriangleGeometryDescriptor {}
920);
921
922unsafe impl CopyingHelper for MTLAccelerationStructureMotionTriangleGeometryDescriptor {
923    type Result = Self;
924}
925
926extern_conformance!(
927    unsafe impl NSObjectProtocol for MTLAccelerationStructureMotionTriangleGeometryDescriptor {}
928);
929
930impl MTLAccelerationStructureMotionTriangleGeometryDescriptor {
931    extern_methods!(
932        /// Vertex buffer containing triangle vertices similar to what MTLAccelerationStructureTriangleGeometryDescriptor has but array of the values.
933        #[unsafe(method(vertexBuffers))]
934        #[unsafe(method_family = none)]
935        pub fn vertexBuffers(&self) -> Retained<NSArray<MTLMotionKeyframeData>>;
936
937        /// Setter for [`vertexBuffers`][Self::vertexBuffers].
938        ///
939        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
940        #[unsafe(method(setVertexBuffers:))]
941        #[unsafe(method_family = none)]
942        pub fn setVertexBuffers(&self, vertex_buffers: &NSArray<MTLMotionKeyframeData>);
943
944        #[cfg(feature = "MTLStageInputOutputDescriptor")]
945        /// Format type of the vertex buffers across all keyframes.
946        /// Defaults to MTLAttributeFormatFloat3 (packed).
947        #[unsafe(method(vertexFormat))]
948        #[unsafe(method_family = none)]
949        pub fn vertexFormat(&self) -> MTLAttributeFormat;
950
951        #[cfg(feature = "MTLStageInputOutputDescriptor")]
952        /// Setter for [`vertexFormat`][Self::vertexFormat].
953        #[unsafe(method(setVertexFormat:))]
954        #[unsafe(method_family = none)]
955        pub fn setVertexFormat(&self, vertex_format: MTLAttributeFormat);
956
957        /// Stride, in bytes, between vertices in each keyframe's vertex buffer. Must be a multiple of the vertex format data type size and must be aligned to
958        /// the vertex format data type's alignment. Defaults to 0, which will result in a stride of the vertex format data size.
959        #[unsafe(method(vertexStride))]
960        #[unsafe(method_family = none)]
961        pub fn vertexStride(&self) -> NSUInteger;
962
963        /// Setter for [`vertexStride`][Self::vertexStride].
964        ///
965        /// # Safety
966        ///
967        /// This might not be bounds-checked.
968        #[unsafe(method(setVertexStride:))]
969        #[unsafe(method_family = none)]
970        pub unsafe fn setVertexStride(&self, vertex_stride: NSUInteger);
971
972        #[cfg(all(
973            feature = "MTLAllocation",
974            feature = "MTLBuffer",
975            feature = "MTLResource"
976        ))]
977        /// Optional index buffer containing references to vertices in the vertex buffer. May be nil.
978        #[unsafe(method(indexBuffer))]
979        #[unsafe(method_family = none)]
980        pub fn indexBuffer(&self) -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
981
982        #[cfg(all(
983            feature = "MTLAllocation",
984            feature = "MTLBuffer",
985            feature = "MTLResource"
986        ))]
987        /// Setter for [`indexBuffer`][Self::indexBuffer].
988        ///
989        /// # Safety
990        ///
991        /// - `index_buffer` may need to be synchronized.
992        /// - `index_buffer` may be unretained, you must ensure it is kept alive while in use.
993        /// - `index_buffer` contents should be of the correct type.
994        #[unsafe(method(setIndexBuffer:))]
995        #[unsafe(method_family = none)]
996        pub unsafe fn setIndexBuffer(&self, index_buffer: Option<&ProtocolObject<dyn MTLBuffer>>);
997
998        /// Index buffer offset. Must be a multiple of the index data type size and must be aligned to both
999        /// the index data type's alignment and the platform's buffer offset alignment.
1000        #[unsafe(method(indexBufferOffset))]
1001        #[unsafe(method_family = none)]
1002        pub fn indexBufferOffset(&self) -> NSUInteger;
1003
1004        /// Setter for [`indexBufferOffset`][Self::indexBufferOffset].
1005        ///
1006        /// # Safety
1007        ///
1008        /// This might not be bounds-checked.
1009        #[unsafe(method(setIndexBufferOffset:))]
1010        #[unsafe(method_family = none)]
1011        pub unsafe fn setIndexBufferOffset(&self, index_buffer_offset: NSUInteger);
1012
1013        #[cfg(feature = "MTLArgument")]
1014        /// Index type
1015        #[unsafe(method(indexType))]
1016        #[unsafe(method_family = none)]
1017        pub fn indexType(&self) -> MTLIndexType;
1018
1019        #[cfg(feature = "MTLArgument")]
1020        /// Setter for [`indexType`][Self::indexType].
1021        #[unsafe(method(setIndexType:))]
1022        #[unsafe(method_family = none)]
1023        pub fn setIndexType(&self, index_type: MTLIndexType);
1024
1025        /// Number of triangles
1026        #[unsafe(method(triangleCount))]
1027        #[unsafe(method_family = none)]
1028        pub fn triangleCount(&self) -> NSUInteger;
1029
1030        /// Setter for [`triangleCount`][Self::triangleCount].
1031        ///
1032        /// # Safety
1033        ///
1034        /// This might not be bounds-checked.
1035        #[unsafe(method(setTriangleCount:))]
1036        #[unsafe(method_family = none)]
1037        pub unsafe fn setTriangleCount(&self, triangle_count: NSUInteger);
1038
1039        #[cfg(all(
1040            feature = "MTLAllocation",
1041            feature = "MTLBuffer",
1042            feature = "MTLResource"
1043        ))]
1044        /// Buffer containing packed float4x3 transformation matrix. Transform is applied to the vertex data when building the acceleration structure. Input vertex buffers are not modified.
1045        /// The transformation matrix is applied to all keyframes' vertex data.
1046        /// When set to nil, transformation matrix is not applied to vertex data.
1047        #[unsafe(method(transformationMatrixBuffer))]
1048        #[unsafe(method_family = none)]
1049        pub fn transformationMatrixBuffer(&self)
1050            -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
1051
1052        #[cfg(all(
1053            feature = "MTLAllocation",
1054            feature = "MTLBuffer",
1055            feature = "MTLResource"
1056        ))]
1057        /// Setter for [`transformationMatrixBuffer`][Self::transformationMatrixBuffer].
1058        ///
1059        /// # Safety
1060        ///
1061        /// - `transformation_matrix_buffer` may need to be synchronized.
1062        /// - `transformation_matrix_buffer` may be unretained, you must ensure it is kept alive while in use.
1063        /// - `transformation_matrix_buffer` contents should be of the correct type.
1064        #[unsafe(method(setTransformationMatrixBuffer:))]
1065        #[unsafe(method_family = none)]
1066        pub unsafe fn setTransformationMatrixBuffer(
1067            &self,
1068            transformation_matrix_buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
1069        );
1070
1071        /// Transformation matrix buffer offset. Must be a multiple of 4 bytes. Defaults to 0.
1072        #[unsafe(method(transformationMatrixBufferOffset))]
1073        #[unsafe(method_family = none)]
1074        pub fn transformationMatrixBufferOffset(&self) -> NSUInteger;
1075
1076        /// Setter for [`transformationMatrixBufferOffset`][Self::transformationMatrixBufferOffset].
1077        ///
1078        /// # Safety
1079        ///
1080        /// This might not be bounds-checked.
1081        #[unsafe(method(setTransformationMatrixBufferOffset:))]
1082        #[unsafe(method_family = none)]
1083        pub unsafe fn setTransformationMatrixBufferOffset(
1084            &self,
1085            transformation_matrix_buffer_offset: NSUInteger,
1086        );
1087
1088        /// Matrix layout for the transformation matrix in the transformation
1089        /// matrix buffer. Defaults to MTLMatrixLayoutColumnMajor.
1090        #[unsafe(method(transformationMatrixLayout))]
1091        #[unsafe(method_family = none)]
1092        pub fn transformationMatrixLayout(&self) -> MTLMatrixLayout;
1093
1094        /// Setter for [`transformationMatrixLayout`][Self::transformationMatrixLayout].
1095        #[unsafe(method(setTransformationMatrixLayout:))]
1096        #[unsafe(method_family = none)]
1097        pub fn setTransformationMatrixLayout(&self, transformation_matrix_layout: MTLMatrixLayout);
1098
1099        #[unsafe(method(descriptor))]
1100        #[unsafe(method_family = none)]
1101        pub fn descriptor() -> Retained<Self>;
1102    );
1103}
1104
1105/// Methods declared on superclass `NSObject`.
1106impl MTLAccelerationStructureMotionTriangleGeometryDescriptor {
1107    extern_methods!(
1108        #[unsafe(method(init))]
1109        #[unsafe(method_family = init)]
1110        pub fn init(this: Allocated<Self>) -> Retained<Self>;
1111
1112        #[unsafe(method(new))]
1113        #[unsafe(method_family = new)]
1114        pub fn new() -> Retained<Self>;
1115    );
1116}
1117
1118impl DefaultRetained for MTLAccelerationStructureMotionTriangleGeometryDescriptor {
1119    #[inline]
1120    fn default_retained() -> Retained<Self> {
1121        Self::new()
1122    }
1123}
1124
1125extern_class!(
1126    /// Descriptor for motion bounding box geometry
1127    ///
1128    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlaccelerationstructuremotionboundingboxgeometrydescriptor?language=objc)
1129    #[unsafe(super(MTLAccelerationStructureGeometryDescriptor, NSObject))]
1130    #[derive(Debug, PartialEq, Eq, Hash)]
1131    pub struct MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor;
1132);
1133
1134extern_conformance!(
1135    unsafe impl NSCopying for MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor {}
1136);
1137
1138unsafe impl CopyingHelper for MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor {
1139    type Result = Self;
1140}
1141
1142extern_conformance!(
1143    unsafe impl NSObjectProtocol for MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor {}
1144);
1145
1146impl MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor {
1147    extern_methods!(
1148        /// Bounding box buffer containing MTLAxisAlignedBoundingBoxes similar to what MTLAccelerationStructureBoundingBoxGeometryDescriptor has but array of the values.
1149        #[unsafe(method(boundingBoxBuffers))]
1150        #[unsafe(method_family = none)]
1151        pub fn boundingBoxBuffers(&self) -> Retained<NSArray<MTLMotionKeyframeData>>;
1152
1153        /// Setter for [`boundingBoxBuffers`][Self::boundingBoxBuffers].
1154        ///
1155        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
1156        #[unsafe(method(setBoundingBoxBuffers:))]
1157        #[unsafe(method_family = none)]
1158        pub fn setBoundingBoxBuffers(&self, bounding_box_buffers: &NSArray<MTLMotionKeyframeData>);
1159
1160        /// Stride, in bytes, between bounding boxes in the bounding box buffer. Must be at least 24
1161        /// bytes and must be a multiple of 4 bytes. Defaults to 24 bytes.
1162        #[unsafe(method(boundingBoxStride))]
1163        #[unsafe(method_family = none)]
1164        pub fn boundingBoxStride(&self) -> NSUInteger;
1165
1166        /// Setter for [`boundingBoxStride`][Self::boundingBoxStride].
1167        ///
1168        /// # Safety
1169        ///
1170        /// This might not be bounds-checked.
1171        #[unsafe(method(setBoundingBoxStride:))]
1172        #[unsafe(method_family = none)]
1173        pub unsafe fn setBoundingBoxStride(&self, bounding_box_stride: NSUInteger);
1174
1175        /// Number of bounding boxes
1176        #[unsafe(method(boundingBoxCount))]
1177        #[unsafe(method_family = none)]
1178        pub fn boundingBoxCount(&self) -> NSUInteger;
1179
1180        /// Setter for [`boundingBoxCount`][Self::boundingBoxCount].
1181        ///
1182        /// # Safety
1183        ///
1184        /// This might not be bounds-checked.
1185        #[unsafe(method(setBoundingBoxCount:))]
1186        #[unsafe(method_family = none)]
1187        pub unsafe fn setBoundingBoxCount(&self, bounding_box_count: NSUInteger);
1188
1189        #[unsafe(method(descriptor))]
1190        #[unsafe(method_family = none)]
1191        pub fn descriptor() -> Retained<Self>;
1192    );
1193}
1194
1195/// Methods declared on superclass `NSObject`.
1196impl MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor {
1197    extern_methods!(
1198        #[unsafe(method(init))]
1199        #[unsafe(method_family = init)]
1200        pub fn init(this: Allocated<Self>) -> Retained<Self>;
1201
1202        #[unsafe(method(new))]
1203        #[unsafe(method_family = new)]
1204        pub fn new() -> Retained<Self>;
1205    );
1206}
1207
1208impl DefaultRetained for MTLAccelerationStructureMotionBoundingBoxGeometryDescriptor {
1209    #[inline]
1210    fn default_retained() -> Retained<Self> {
1211        Self::new()
1212    }
1213}
1214
1215/// Curve types
1216///
1217/// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlcurvetype?language=objc)
1218// NS_ENUM
1219#[repr(transparent)]
1220#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1221pub struct MTLCurveType(pub NSInteger);
1222impl MTLCurveType {
1223    /// Curve with a circular cross-section. These curves have the
1224    /// advantage of having a real 3D shape consistent across different ray
1225    /// directions, well-defined surface normals, etc. However, they may be
1226    /// slower to intersect. These curves are ideal for viewing close-up.
1227    #[doc(alias = "MTLCurveTypeRound")]
1228    pub const Round: Self = Self(0);
1229    /// Curve with a flat cross-section aligned with the ray direction.
1230    /// These curves may be faster to intersect but do not have a consistent
1231    /// 3D structure across different rays. These curves are ideal for viewing
1232    /// at a distance or curves with a small radius such as hair and fur.
1233    #[doc(alias = "MTLCurveTypeFlat")]
1234    pub const Flat: Self = Self(1);
1235}
1236
1237unsafe impl Encode for MTLCurveType {
1238    const ENCODING: Encoding = NSInteger::ENCODING;
1239}
1240
1241unsafe impl RefEncode for MTLCurveType {
1242    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1243}
1244
1245/// Basis function to use to interpolate curve control points
1246///
1247/// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlcurvebasis?language=objc)
1248// NS_ENUM
1249#[repr(transparent)]
1250#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1251pub struct MTLCurveBasis(pub NSInteger);
1252impl MTLCurveBasis {
1253    /// B-Spline basis. Each curve segment must have 3 or 4 control
1254    /// points. Curve segments join with C^(N - 2) continuity, where N is
1255    /// the number of control points. The curve does not necessarily pass
1256    /// through the control points without additional control points at the
1257    /// beginning and end of the curve. Each curve segment can overlap
1258    /// N-1 control points.
1259    #[doc(alias = "MTLCurveBasisBSpline")]
1260    pub const BSpline: Self = Self(0);
1261    /// Catmull-Rom basis. Curves represented in this basis can also be
1262    /// easily converted to and from the Bézier basis. Each curve segment must
1263    /// have 4 control points. Each index in the control point index buffer
1264    /// points to the first of 4 consecutive control points in the control point
1265    /// buffer.
1266    ///
1267    /// The tangent at each control point is given by
1268    /// (P_(i+1) - P_(i-1)) / 2. Therefore, the curve does not pass through the
1269    /// first and last control point of each connected sequence of curve
1270    /// segments. Instead, the first and last control point are used to control
1271    /// the tangent vector at the beginning and end of the curve.
1272    ///
1273    /// Curve segments join with C^1 continuity and the
1274    /// curve passes through the control points. Each curve segment can overlap
1275    /// 3 control points.
1276    #[doc(alias = "MTLCurveBasisCatmullRom")]
1277    pub const CatmullRom: Self = Self(1);
1278    /// Linear basis. The curve is made of a sequence of connected line
1279    /// segments each with 2 control points.
1280    #[doc(alias = "MTLCurveBasisLinear")]
1281    pub const Linear: Self = Self(2);
1282    /// Bezier basis
1283    #[doc(alias = "MTLCurveBasisBezier")]
1284    pub const Bezier: Self = Self(3);
1285}
1286
1287unsafe impl Encode for MTLCurveBasis {
1288    const ENCODING: Encoding = NSInteger::ENCODING;
1289}
1290
1291unsafe impl RefEncode for MTLCurveBasis {
1292    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1293}
1294
1295/// Type of end cap to insert at the beginning and end of each connected
1296/// sequence of curve segments.
1297///
1298/// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlcurveendcaps?language=objc)
1299// NS_ENUM
1300#[repr(transparent)]
1301#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1302pub struct MTLCurveEndCaps(pub NSInteger);
1303impl MTLCurveEndCaps {
1304    /// No end caps
1305    #[doc(alias = "MTLCurveEndCapsNone")]
1306    pub const None: Self = Self(0);
1307    /// Disk end caps
1308    #[doc(alias = "MTLCurveEndCapsDisk")]
1309    pub const Disk: Self = Self(1);
1310    /// Spherical end caps
1311    #[doc(alias = "MTLCurveEndCapsSphere")]
1312    pub const Sphere: Self = Self(2);
1313}
1314
1315unsafe impl Encode for MTLCurveEndCaps {
1316    const ENCODING: Encoding = NSInteger::ENCODING;
1317}
1318
1319unsafe impl RefEncode for MTLCurveEndCaps {
1320    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1321}
1322
1323extern_class!(
1324    /// Acceleration structure geometry descriptor describing geometry
1325    /// made of curve primitives
1326    ///
1327    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlaccelerationstructurecurvegeometrydescriptor?language=objc)
1328    #[unsafe(super(MTLAccelerationStructureGeometryDescriptor, NSObject))]
1329    #[derive(Debug, PartialEq, Eq, Hash)]
1330    pub struct MTLAccelerationStructureCurveGeometryDescriptor;
1331);
1332
1333extern_conformance!(
1334    unsafe impl NSCopying for MTLAccelerationStructureCurveGeometryDescriptor {}
1335);
1336
1337unsafe impl CopyingHelper for MTLAccelerationStructureCurveGeometryDescriptor {
1338    type Result = Self;
1339}
1340
1341extern_conformance!(
1342    unsafe impl NSObjectProtocol for MTLAccelerationStructureCurveGeometryDescriptor {}
1343);
1344
1345impl MTLAccelerationStructureCurveGeometryDescriptor {
1346    extern_methods!(
1347        #[cfg(all(
1348            feature = "MTLAllocation",
1349            feature = "MTLBuffer",
1350            feature = "MTLResource"
1351        ))]
1352        /// Buffer containing curve control points. Each control point must
1353        /// be of the format specified by the control point format. Must not be
1354        /// nil when the acceleration structure is built.
1355        #[unsafe(method(controlPointBuffer))]
1356        #[unsafe(method_family = none)]
1357        pub fn controlPointBuffer(&self) -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
1358
1359        #[cfg(all(
1360            feature = "MTLAllocation",
1361            feature = "MTLBuffer",
1362            feature = "MTLResource"
1363        ))]
1364        /// Setter for [`controlPointBuffer`][Self::controlPointBuffer].
1365        ///
1366        /// # Safety
1367        ///
1368        /// - `control_point_buffer` may need to be synchronized.
1369        /// - `control_point_buffer` may be unretained, you must ensure it is kept alive while in use.
1370        /// - `control_point_buffer` contents should be of the correct type.
1371        #[unsafe(method(setControlPointBuffer:))]
1372        #[unsafe(method_family = none)]
1373        pub unsafe fn setControlPointBuffer(
1374            &self,
1375            control_point_buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
1376        );
1377
1378        /// Control point buffer offset. Must be a multiple of the control
1379        /// point format's element size and must be aligned to the platform's
1380        /// buffer offset alignment.
1381        #[unsafe(method(controlPointBufferOffset))]
1382        #[unsafe(method_family = none)]
1383        pub fn controlPointBufferOffset(&self) -> NSUInteger;
1384
1385        /// Setter for [`controlPointBufferOffset`][Self::controlPointBufferOffset].
1386        ///
1387        /// # Safety
1388        ///
1389        /// This might not be bounds-checked.
1390        #[unsafe(method(setControlPointBufferOffset:))]
1391        #[unsafe(method_family = none)]
1392        pub unsafe fn setControlPointBufferOffset(&self, control_point_buffer_offset: NSUInteger);
1393
1394        /// Number of control points in the control point buffer
1395        #[unsafe(method(controlPointCount))]
1396        #[unsafe(method_family = none)]
1397        pub fn controlPointCount(&self) -> NSUInteger;
1398
1399        /// Setter for [`controlPointCount`][Self::controlPointCount].
1400        ///
1401        /// # Safety
1402        ///
1403        /// This might not be bounds-checked.
1404        #[unsafe(method(setControlPointCount:))]
1405        #[unsafe(method_family = none)]
1406        pub unsafe fn setControlPointCount(&self, control_point_count: NSUInteger);
1407
1408        /// Stride, in bytes, between control points in the control point
1409        /// buffer. Must be a multiple of the control point format's element size
1410        /// and must be at least the control point format's size. Defaults to 0
1411        /// bytes, indicating that the control points are tightly packed.
1412        #[unsafe(method(controlPointStride))]
1413        #[unsafe(method_family = none)]
1414        pub fn controlPointStride(&self) -> NSUInteger;
1415
1416        /// Setter for [`controlPointStride`][Self::controlPointStride].
1417        ///
1418        /// # Safety
1419        ///
1420        /// This might not be bounds-checked.
1421        #[unsafe(method(setControlPointStride:))]
1422        #[unsafe(method_family = none)]
1423        pub unsafe fn setControlPointStride(&self, control_point_stride: NSUInteger);
1424
1425        #[cfg(feature = "MTLStageInputOutputDescriptor")]
1426        /// Format of the control points in the control point buffer.
1427        /// Defaults to MTLAttributeFormatFloat3 (packed).
1428        #[unsafe(method(controlPointFormat))]
1429        #[unsafe(method_family = none)]
1430        pub fn controlPointFormat(&self) -> MTLAttributeFormat;
1431
1432        #[cfg(feature = "MTLStageInputOutputDescriptor")]
1433        /// Setter for [`controlPointFormat`][Self::controlPointFormat].
1434        #[unsafe(method(setControlPointFormat:))]
1435        #[unsafe(method_family = none)]
1436        pub fn setControlPointFormat(&self, control_point_format: MTLAttributeFormat);
1437
1438        #[cfg(all(
1439            feature = "MTLAllocation",
1440            feature = "MTLBuffer",
1441            feature = "MTLResource"
1442        ))]
1443        /// Buffer containing the curve radius for each control point. Each
1444        /// radius must be of the type specified by the radius format. Each radius
1445        /// must be at least zero. Must not be nil when the acceleration structure
1446        /// is built.
1447        #[unsafe(method(radiusBuffer))]
1448        #[unsafe(method_family = none)]
1449        pub fn radiusBuffer(&self) -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
1450
1451        #[cfg(all(
1452            feature = "MTLAllocation",
1453            feature = "MTLBuffer",
1454            feature = "MTLResource"
1455        ))]
1456        /// Setter for [`radiusBuffer`][Self::radiusBuffer].
1457        ///
1458        /// # Safety
1459        ///
1460        /// - `radius_buffer` may need to be synchronized.
1461        /// - `radius_buffer` may be unretained, you must ensure it is kept alive while in use.
1462        /// - `radius_buffer` contents should be of the correct type.
1463        #[unsafe(method(setRadiusBuffer:))]
1464        #[unsafe(method_family = none)]
1465        pub unsafe fn setRadiusBuffer(&self, radius_buffer: Option<&ProtocolObject<dyn MTLBuffer>>);
1466
1467        /// Radius buffer offset. Must be a multiple of the radius format
1468        /// size and must be aligned to the platform's buffer offset alignment.
1469        #[unsafe(method(radiusBufferOffset))]
1470        #[unsafe(method_family = none)]
1471        pub fn radiusBufferOffset(&self) -> NSUInteger;
1472
1473        /// Setter for [`radiusBufferOffset`][Self::radiusBufferOffset].
1474        ///
1475        /// # Safety
1476        ///
1477        /// This might not be bounds-checked.
1478        #[unsafe(method(setRadiusBufferOffset:))]
1479        #[unsafe(method_family = none)]
1480        pub unsafe fn setRadiusBufferOffset(&self, radius_buffer_offset: NSUInteger);
1481
1482        #[cfg(feature = "MTLStageInputOutputDescriptor")]
1483        /// Format of the radii in the radius buffer. Defaults to
1484        /// MTLAttributeFormatFloat.
1485        #[unsafe(method(radiusFormat))]
1486        #[unsafe(method_family = none)]
1487        pub fn radiusFormat(&self) -> MTLAttributeFormat;
1488
1489        #[cfg(feature = "MTLStageInputOutputDescriptor")]
1490        /// Setter for [`radiusFormat`][Self::radiusFormat].
1491        #[unsafe(method(setRadiusFormat:))]
1492        #[unsafe(method_family = none)]
1493        pub fn setRadiusFormat(&self, radius_format: MTLAttributeFormat);
1494
1495        /// Stride, in bytes, between radii in the radius buffer. Must be
1496        /// a multiple of the radius format size. Defaults to 0 bytes, indicating
1497        /// that the radii are tightly packed.
1498        #[unsafe(method(radiusStride))]
1499        #[unsafe(method_family = none)]
1500        pub fn radiusStride(&self) -> NSUInteger;
1501
1502        /// Setter for [`radiusStride`][Self::radiusStride].
1503        ///
1504        /// # Safety
1505        ///
1506        /// This might not be bounds-checked.
1507        #[unsafe(method(setRadiusStride:))]
1508        #[unsafe(method_family = none)]
1509        pub unsafe fn setRadiusStride(&self, radius_stride: NSUInteger);
1510
1511        #[cfg(all(
1512            feature = "MTLAllocation",
1513            feature = "MTLBuffer",
1514            feature = "MTLResource"
1515        ))]
1516        /// Index buffer containing references to control points in the control
1517        /// point buffer. Must not be nil when the acceleration structure is built.
1518        #[unsafe(method(indexBuffer))]
1519        #[unsafe(method_family = none)]
1520        pub fn indexBuffer(&self) -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
1521
1522        #[cfg(all(
1523            feature = "MTLAllocation",
1524            feature = "MTLBuffer",
1525            feature = "MTLResource"
1526        ))]
1527        /// Setter for [`indexBuffer`][Self::indexBuffer].
1528        ///
1529        /// # Safety
1530        ///
1531        /// - `index_buffer` may need to be synchronized.
1532        /// - `index_buffer` may be unretained, you must ensure it is kept alive while in use.
1533        /// - `index_buffer` contents should be of the correct type.
1534        #[unsafe(method(setIndexBuffer:))]
1535        #[unsafe(method_family = none)]
1536        pub unsafe fn setIndexBuffer(&self, index_buffer: Option<&ProtocolObject<dyn MTLBuffer>>);
1537
1538        /// Index buffer offset. Must be a multiple of the index data type
1539        /// size and must be aligned to both the index data type's alignment and
1540        /// the platform's buffer offset alignment.
1541        #[unsafe(method(indexBufferOffset))]
1542        #[unsafe(method_family = none)]
1543        pub fn indexBufferOffset(&self) -> NSUInteger;
1544
1545        /// Setter for [`indexBufferOffset`][Self::indexBufferOffset].
1546        ///
1547        /// # Safety
1548        ///
1549        /// This might not be bounds-checked.
1550        #[unsafe(method(setIndexBufferOffset:))]
1551        #[unsafe(method_family = none)]
1552        pub unsafe fn setIndexBufferOffset(&self, index_buffer_offset: NSUInteger);
1553
1554        #[cfg(feature = "MTLArgument")]
1555        /// Index type
1556        #[unsafe(method(indexType))]
1557        #[unsafe(method_family = none)]
1558        pub fn indexType(&self) -> MTLIndexType;
1559
1560        #[cfg(feature = "MTLArgument")]
1561        /// Setter for [`indexType`][Self::indexType].
1562        #[unsafe(method(setIndexType:))]
1563        #[unsafe(method_family = none)]
1564        pub fn setIndexType(&self, index_type: MTLIndexType);
1565
1566        /// Number of curve segments
1567        #[unsafe(method(segmentCount))]
1568        #[unsafe(method_family = none)]
1569        pub fn segmentCount(&self) -> NSUInteger;
1570
1571        /// Setter for [`segmentCount`][Self::segmentCount].
1572        ///
1573        /// # Safety
1574        ///
1575        /// This might not be bounds-checked.
1576        #[unsafe(method(setSegmentCount:))]
1577        #[unsafe(method_family = none)]
1578        pub unsafe fn setSegmentCount(&self, segment_count: NSUInteger);
1579
1580        /// Number of control points per curve segment. Must be 2, 3, or 4.
1581        #[unsafe(method(segmentControlPointCount))]
1582        #[unsafe(method_family = none)]
1583        pub fn segmentControlPointCount(&self) -> NSUInteger;
1584
1585        /// Setter for [`segmentControlPointCount`][Self::segmentControlPointCount].
1586        ///
1587        /// # Safety
1588        ///
1589        /// This might not be bounds-checked.
1590        #[unsafe(method(setSegmentControlPointCount:))]
1591        #[unsafe(method_family = none)]
1592        pub unsafe fn setSegmentControlPointCount(&self, segment_control_point_count: NSUInteger);
1593
1594        /// Curve type. Defaults to MTLCurveTypeRound.
1595        #[unsafe(method(curveType))]
1596        #[unsafe(method_family = none)]
1597        pub fn curveType(&self) -> MTLCurveType;
1598
1599        /// Setter for [`curveType`][Self::curveType].
1600        #[unsafe(method(setCurveType:))]
1601        #[unsafe(method_family = none)]
1602        pub fn setCurveType(&self, curve_type: MTLCurveType);
1603
1604        /// Curve basis. Defaults to MTLCurveBasisBSpline.
1605        #[unsafe(method(curveBasis))]
1606        #[unsafe(method_family = none)]
1607        pub fn curveBasis(&self) -> MTLCurveBasis;
1608
1609        /// Setter for [`curveBasis`][Self::curveBasis].
1610        #[unsafe(method(setCurveBasis:))]
1611        #[unsafe(method_family = none)]
1612        pub fn setCurveBasis(&self, curve_basis: MTLCurveBasis);
1613
1614        /// Type of curve end caps. Defaults to MTLCurveEndCapsNone.
1615        #[unsafe(method(curveEndCaps))]
1616        #[unsafe(method_family = none)]
1617        pub fn curveEndCaps(&self) -> MTLCurveEndCaps;
1618
1619        /// Setter for [`curveEndCaps`][Self::curveEndCaps].
1620        #[unsafe(method(setCurveEndCaps:))]
1621        #[unsafe(method_family = none)]
1622        pub fn setCurveEndCaps(&self, curve_end_caps: MTLCurveEndCaps);
1623
1624        #[unsafe(method(descriptor))]
1625        #[unsafe(method_family = none)]
1626        pub fn descriptor() -> Retained<Self>;
1627    );
1628}
1629
1630/// Methods declared on superclass `NSObject`.
1631impl MTLAccelerationStructureCurveGeometryDescriptor {
1632    extern_methods!(
1633        #[unsafe(method(init))]
1634        #[unsafe(method_family = init)]
1635        pub fn init(this: Allocated<Self>) -> Retained<Self>;
1636
1637        #[unsafe(method(new))]
1638        #[unsafe(method_family = new)]
1639        pub fn new() -> Retained<Self>;
1640    );
1641}
1642
1643impl DefaultRetained for MTLAccelerationStructureCurveGeometryDescriptor {
1644    #[inline]
1645    fn default_retained() -> Retained<Self> {
1646        Self::new()
1647    }
1648}
1649
1650extern_class!(
1651    /// Acceleration structure motion geometry descriptor describing
1652    /// geometry made of curve primitives
1653    ///
1654    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlaccelerationstructuremotioncurvegeometrydescriptor?language=objc)
1655    #[unsafe(super(MTLAccelerationStructureGeometryDescriptor, NSObject))]
1656    #[derive(Debug, PartialEq, Eq, Hash)]
1657    pub struct MTLAccelerationStructureMotionCurveGeometryDescriptor;
1658);
1659
1660extern_conformance!(
1661    unsafe impl NSCopying for MTLAccelerationStructureMotionCurveGeometryDescriptor {}
1662);
1663
1664unsafe impl CopyingHelper for MTLAccelerationStructureMotionCurveGeometryDescriptor {
1665    type Result = Self;
1666}
1667
1668extern_conformance!(
1669    unsafe impl NSObjectProtocol for MTLAccelerationStructureMotionCurveGeometryDescriptor {}
1670);
1671
1672impl MTLAccelerationStructureMotionCurveGeometryDescriptor {
1673    extern_methods!(
1674        /// Buffers containing curve control points for each keyframe.
1675        /// Each control point must be of the format specified by the control
1676        /// point format. Buffer offsets musts be multiples of the control
1677        /// point format's element size and must be aligned to the platform's
1678        /// buffer offset alignment. Must not be nil when the acceleration
1679        /// structure is built.
1680        #[unsafe(method(controlPointBuffers))]
1681        #[unsafe(method_family = none)]
1682        pub fn controlPointBuffers(&self) -> Retained<NSArray<MTLMotionKeyframeData>>;
1683
1684        /// Setter for [`controlPointBuffers`][Self::controlPointBuffers].
1685        ///
1686        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
1687        #[unsafe(method(setControlPointBuffers:))]
1688        #[unsafe(method_family = none)]
1689        pub fn setControlPointBuffers(
1690            &self,
1691            control_point_buffers: &NSArray<MTLMotionKeyframeData>,
1692        );
1693
1694        /// Number of control points in the control point buffers
1695        #[unsafe(method(controlPointCount))]
1696        #[unsafe(method_family = none)]
1697        pub fn controlPointCount(&self) -> NSUInteger;
1698
1699        /// Setter for [`controlPointCount`][Self::controlPointCount].
1700        ///
1701        /// # Safety
1702        ///
1703        /// This might not be bounds-checked.
1704        #[unsafe(method(setControlPointCount:))]
1705        #[unsafe(method_family = none)]
1706        pub unsafe fn setControlPointCount(&self, control_point_count: NSUInteger);
1707
1708        /// Stride, in bytes, between control points in the control point
1709        /// buffer. Must be a multiple of the control point format's element size
1710        /// and must be at least the control point format's size. Defaults to 0
1711        /// bytes, indicating that the control points are tightly packed.
1712        #[unsafe(method(controlPointStride))]
1713        #[unsafe(method_family = none)]
1714        pub fn controlPointStride(&self) -> NSUInteger;
1715
1716        /// Setter for [`controlPointStride`][Self::controlPointStride].
1717        ///
1718        /// # Safety
1719        ///
1720        /// This might not be bounds-checked.
1721        #[unsafe(method(setControlPointStride:))]
1722        #[unsafe(method_family = none)]
1723        pub unsafe fn setControlPointStride(&self, control_point_stride: NSUInteger);
1724
1725        #[cfg(feature = "MTLStageInputOutputDescriptor")]
1726        /// Format of the control points in the control point buffer.
1727        /// Defaults to MTLAttributeFormatFloat3 (packed).
1728        #[unsafe(method(controlPointFormat))]
1729        #[unsafe(method_family = none)]
1730        pub fn controlPointFormat(&self) -> MTLAttributeFormat;
1731
1732        #[cfg(feature = "MTLStageInputOutputDescriptor")]
1733        /// Setter for [`controlPointFormat`][Self::controlPointFormat].
1734        #[unsafe(method(setControlPointFormat:))]
1735        #[unsafe(method_family = none)]
1736        pub fn setControlPointFormat(&self, control_point_format: MTLAttributeFormat);
1737
1738        /// Buffers containing the curve radius for each control point for
1739        /// each keyframe. Each radius must be of the type specified by the radius
1740        /// format. Buffer offsets must be multiples of the radius format size
1741        /// and must be aligned to the platform's buffer offset alignment. Each radius
1742        /// must be at least zero. Must not be nil when the acceleration structure
1743        /// is built.
1744        #[unsafe(method(radiusBuffers))]
1745        #[unsafe(method_family = none)]
1746        pub fn radiusBuffers(&self) -> Retained<NSArray<MTLMotionKeyframeData>>;
1747
1748        /// Setter for [`radiusBuffers`][Self::radiusBuffers].
1749        ///
1750        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
1751        #[unsafe(method(setRadiusBuffers:))]
1752        #[unsafe(method_family = none)]
1753        pub fn setRadiusBuffers(&self, radius_buffers: &NSArray<MTLMotionKeyframeData>);
1754
1755        #[cfg(feature = "MTLStageInputOutputDescriptor")]
1756        /// Format of the radii in the radius buffer. Defaults to
1757        /// MTLAttributeFormatFloat.
1758        #[unsafe(method(radiusFormat))]
1759        #[unsafe(method_family = none)]
1760        pub fn radiusFormat(&self) -> MTLAttributeFormat;
1761
1762        #[cfg(feature = "MTLStageInputOutputDescriptor")]
1763        /// Setter for [`radiusFormat`][Self::radiusFormat].
1764        #[unsafe(method(setRadiusFormat:))]
1765        #[unsafe(method_family = none)]
1766        pub fn setRadiusFormat(&self, radius_format: MTLAttributeFormat);
1767
1768        /// Stride, in bytes, between radii in the radius buffer. Must be
1769        /// a multiple of 4 bytes. Defaults to 4 bytes.
1770        #[unsafe(method(radiusStride))]
1771        #[unsafe(method_family = none)]
1772        pub fn radiusStride(&self) -> NSUInteger;
1773
1774        /// Setter for [`radiusStride`][Self::radiusStride].
1775        ///
1776        /// # Safety
1777        ///
1778        /// This might not be bounds-checked.
1779        #[unsafe(method(setRadiusStride:))]
1780        #[unsafe(method_family = none)]
1781        pub unsafe fn setRadiusStride(&self, radius_stride: NSUInteger);
1782
1783        #[cfg(all(
1784            feature = "MTLAllocation",
1785            feature = "MTLBuffer",
1786            feature = "MTLResource"
1787        ))]
1788        /// Index buffer containing references to control points in the control
1789        /// point buffer. Must not be nil.
1790        #[unsafe(method(indexBuffer))]
1791        #[unsafe(method_family = none)]
1792        pub fn indexBuffer(&self) -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
1793
1794        #[cfg(all(
1795            feature = "MTLAllocation",
1796            feature = "MTLBuffer",
1797            feature = "MTLResource"
1798        ))]
1799        /// Setter for [`indexBuffer`][Self::indexBuffer].
1800        ///
1801        /// # Safety
1802        ///
1803        /// - `index_buffer` may need to be synchronized.
1804        /// - `index_buffer` may be unretained, you must ensure it is kept alive while in use.
1805        /// - `index_buffer` contents should be of the correct type.
1806        #[unsafe(method(setIndexBuffer:))]
1807        #[unsafe(method_family = none)]
1808        pub unsafe fn setIndexBuffer(&self, index_buffer: Option<&ProtocolObject<dyn MTLBuffer>>);
1809
1810        /// Index buffer offset. Must be a multiple of the index data type
1811        /// size and must be aligned to both the index data type's alignment and
1812        /// the platform's buffer offset alignment.
1813        #[unsafe(method(indexBufferOffset))]
1814        #[unsafe(method_family = none)]
1815        pub fn indexBufferOffset(&self) -> NSUInteger;
1816
1817        /// Setter for [`indexBufferOffset`][Self::indexBufferOffset].
1818        ///
1819        /// # Safety
1820        ///
1821        /// This might not be bounds-checked.
1822        #[unsafe(method(setIndexBufferOffset:))]
1823        #[unsafe(method_family = none)]
1824        pub unsafe fn setIndexBufferOffset(&self, index_buffer_offset: NSUInteger);
1825
1826        #[cfg(feature = "MTLArgument")]
1827        /// Index type
1828        #[unsafe(method(indexType))]
1829        #[unsafe(method_family = none)]
1830        pub fn indexType(&self) -> MTLIndexType;
1831
1832        #[cfg(feature = "MTLArgument")]
1833        /// Setter for [`indexType`][Self::indexType].
1834        #[unsafe(method(setIndexType:))]
1835        #[unsafe(method_family = none)]
1836        pub fn setIndexType(&self, index_type: MTLIndexType);
1837
1838        /// Number of curve segments
1839        #[unsafe(method(segmentCount))]
1840        #[unsafe(method_family = none)]
1841        pub fn segmentCount(&self) -> NSUInteger;
1842
1843        /// Setter for [`segmentCount`][Self::segmentCount].
1844        ///
1845        /// # Safety
1846        ///
1847        /// This might not be bounds-checked.
1848        #[unsafe(method(setSegmentCount:))]
1849        #[unsafe(method_family = none)]
1850        pub unsafe fn setSegmentCount(&self, segment_count: NSUInteger);
1851
1852        /// Number of control points per curve segment. Must be 2, 3, or 4.
1853        #[unsafe(method(segmentControlPointCount))]
1854        #[unsafe(method_family = none)]
1855        pub fn segmentControlPointCount(&self) -> NSUInteger;
1856
1857        /// Setter for [`segmentControlPointCount`][Self::segmentControlPointCount].
1858        ///
1859        /// # Safety
1860        ///
1861        /// This might not be bounds-checked.
1862        #[unsafe(method(setSegmentControlPointCount:))]
1863        #[unsafe(method_family = none)]
1864        pub unsafe fn setSegmentControlPointCount(&self, segment_control_point_count: NSUInteger);
1865
1866        /// Curve type. Defaults to MTLCurveTypeRound.
1867        #[unsafe(method(curveType))]
1868        #[unsafe(method_family = none)]
1869        pub fn curveType(&self) -> MTLCurveType;
1870
1871        /// Setter for [`curveType`][Self::curveType].
1872        #[unsafe(method(setCurveType:))]
1873        #[unsafe(method_family = none)]
1874        pub fn setCurveType(&self, curve_type: MTLCurveType);
1875
1876        /// Curve basis. Defaults to MTLCurveBasisBSpline.
1877        #[unsafe(method(curveBasis))]
1878        #[unsafe(method_family = none)]
1879        pub fn curveBasis(&self) -> MTLCurveBasis;
1880
1881        /// Setter for [`curveBasis`][Self::curveBasis].
1882        #[unsafe(method(setCurveBasis:))]
1883        #[unsafe(method_family = none)]
1884        pub fn setCurveBasis(&self, curve_basis: MTLCurveBasis);
1885
1886        /// Type of curve end caps. Defaults to MTLCurveEndCapsNone.
1887        #[unsafe(method(curveEndCaps))]
1888        #[unsafe(method_family = none)]
1889        pub fn curveEndCaps(&self) -> MTLCurveEndCaps;
1890
1891        /// Setter for [`curveEndCaps`][Self::curveEndCaps].
1892        #[unsafe(method(setCurveEndCaps:))]
1893        #[unsafe(method_family = none)]
1894        pub fn setCurveEndCaps(&self, curve_end_caps: MTLCurveEndCaps);
1895
1896        #[unsafe(method(descriptor))]
1897        #[unsafe(method_family = none)]
1898        pub fn descriptor() -> Retained<Self>;
1899    );
1900}
1901
1902/// Methods declared on superclass `NSObject`.
1903impl MTLAccelerationStructureMotionCurveGeometryDescriptor {
1904    extern_methods!(
1905        #[unsafe(method(init))]
1906        #[unsafe(method_family = init)]
1907        pub fn init(this: Allocated<Self>) -> Retained<Self>;
1908
1909        #[unsafe(method(new))]
1910        #[unsafe(method_family = new)]
1911        pub fn new() -> Retained<Self>;
1912    );
1913}
1914
1915impl DefaultRetained for MTLAccelerationStructureMotionCurveGeometryDescriptor {
1916    #[inline]
1917    fn default_retained() -> Retained<Self> {
1918        Self::new()
1919    }
1920}
1921
1922/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlaccelerationstructureinstancedescriptor?language=objc)
1923#[cfg(feature = "MTLAccelerationStructureTypes")]
1924#[repr(C)]
1925#[derive(Clone, Copy, Debug, PartialEq)]
1926pub struct MTLAccelerationStructureInstanceDescriptor {
1927    /// Transformation matrix describing how to transform the bottom-level acceleration structure.
1928    pub transformationMatrix: MTLPackedFloat4x3,
1929    /// Instance options
1930    pub options: MTLAccelerationStructureInstanceOptions,
1931    /// Instance mask used to ignore geometry during ray tracing
1932    pub mask: u32,
1933    /// Used to index into intersection function tables
1934    pub intersectionFunctionTableOffset: u32,
1935    /// Acceleration structure index to use for this instance
1936    pub accelerationStructureIndex: u32,
1937}
1938
1939#[cfg(feature = "MTLAccelerationStructureTypes")]
1940unsafe impl Encode for MTLAccelerationStructureInstanceDescriptor {
1941    const ENCODING: Encoding = Encoding::Struct(
1942        "?",
1943        &[
1944            <MTLPackedFloat4x3>::ENCODING,
1945            <MTLAccelerationStructureInstanceOptions>::ENCODING,
1946            <u32>::ENCODING,
1947            <u32>::ENCODING,
1948            <u32>::ENCODING,
1949        ],
1950    );
1951}
1952
1953#[cfg(feature = "MTLAccelerationStructureTypes")]
1954unsafe impl RefEncode for MTLAccelerationStructureInstanceDescriptor {
1955    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1956}
1957
1958/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlaccelerationstructureuseridinstancedescriptor?language=objc)
1959#[cfg(feature = "MTLAccelerationStructureTypes")]
1960#[repr(C)]
1961#[derive(Clone, Copy, Debug, PartialEq)]
1962pub struct MTLAccelerationStructureUserIDInstanceDescriptor {
1963    /// Transformation matrix describing how to transform the bottom-level acceleration structure.
1964    pub transformationMatrix: MTLPackedFloat4x3,
1965    /// Instance options
1966    pub options: MTLAccelerationStructureInstanceOptions,
1967    /// Instance mask used to ignore geometry during ray tracing
1968    pub mask: u32,
1969    /// Used to index into intersection function tables
1970    pub intersectionFunctionTableOffset: u32,
1971    /// Acceleration structure index to use for this instance
1972    pub accelerationStructureIndex: u32,
1973    /// User-assigned instance ID to help identify this instance in an
1974    /// application-defined way
1975    pub userID: u32,
1976}
1977
1978#[cfg(feature = "MTLAccelerationStructureTypes")]
1979unsafe impl Encode for MTLAccelerationStructureUserIDInstanceDescriptor {
1980    const ENCODING: Encoding = Encoding::Struct(
1981        "?",
1982        &[
1983            <MTLPackedFloat4x3>::ENCODING,
1984            <MTLAccelerationStructureInstanceOptions>::ENCODING,
1985            <u32>::ENCODING,
1986            <u32>::ENCODING,
1987            <u32>::ENCODING,
1988            <u32>::ENCODING,
1989        ],
1990    );
1991}
1992
1993#[cfg(feature = "MTLAccelerationStructureTypes")]
1994unsafe impl RefEncode for MTLAccelerationStructureUserIDInstanceDescriptor {
1995    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1996}
1997
1998/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlaccelerationstructureinstancedescriptortype?language=objc)
1999// NS_ENUM
2000#[repr(transparent)]
2001#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2002pub struct MTLAccelerationStructureInstanceDescriptorType(pub NSUInteger);
2003impl MTLAccelerationStructureInstanceDescriptorType {
2004    /// Default instance descriptor: MTLAccelerationStructureInstanceDescriptor
2005    #[doc(alias = "MTLAccelerationStructureInstanceDescriptorTypeDefault")]
2006    pub const Default: Self = Self(0);
2007    /// Instance descriptor with an added user-ID
2008    #[doc(alias = "MTLAccelerationStructureInstanceDescriptorTypeUserID")]
2009    pub const UserID: Self = Self(1);
2010    /// Instance descriptor with support for motion
2011    #[doc(alias = "MTLAccelerationStructureInstanceDescriptorTypeMotion")]
2012    pub const Motion: Self = Self(2);
2013    /// Instance descriptor with a resource handle for the instanced acceleration structure
2014    #[doc(alias = "MTLAccelerationStructureInstanceDescriptorTypeIndirect")]
2015    pub const Indirect: Self = Self(3);
2016    /// Motion instance descriptor with a resource handle for the instanced acceleration structure.
2017    #[doc(alias = "MTLAccelerationStructureInstanceDescriptorTypeIndirectMotion")]
2018    pub const IndirectMotion: Self = Self(4);
2019}
2020
2021unsafe impl Encode for MTLAccelerationStructureInstanceDescriptorType {
2022    const ENCODING: Encoding = NSUInteger::ENCODING;
2023}
2024
2025unsafe impl RefEncode for MTLAccelerationStructureInstanceDescriptorType {
2026    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2027}
2028
2029/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlaccelerationstructuremotioninstancedescriptor?language=objc)
2030#[repr(C)]
2031#[derive(Clone, Copy, Debug, PartialEq)]
2032pub struct MTLAccelerationStructureMotionInstanceDescriptor {
2033    /// Instance options
2034    pub options: MTLAccelerationStructureInstanceOptions,
2035    /// Instance mask used to ignore geometry during ray tracing
2036    pub mask: u32,
2037    /// Used to index into intersection function tables
2038    pub intersectionFunctionTableOffset: u32,
2039    /// Acceleration structure index to use for this instance
2040    pub accelerationStructureIndex: u32,
2041    /// User-assigned instance ID to help identify this instance in an
2042    /// application-defined way
2043    pub userID: u32,
2044    /// The index of the first set of transforms describing one keyframe of the animation.
2045    /// These transforms are stored in a separate buffer and they are uniformly distributed over
2046    /// time time span of the motion.
2047    pub motionTransformsStartIndex: u32,
2048    /// The count of motion transforms belonging to this motion which are stored in consecutive
2049    /// memory addresses at the separate motionTransforms buffer.
2050    pub motionTransformsCount: u32,
2051    /// Motion border mode describing what happens if acceleration structure is sampled
2052    /// before motionStartTime
2053    pub motionStartBorderMode: MTLMotionBorderMode,
2054    /// Motion border mode describing what happens if acceleration structure is sampled
2055    /// after motionEndTime
2056    pub motionEndBorderMode: MTLMotionBorderMode,
2057    /// Motion start time of this instance
2058    pub motionStartTime: c_float,
2059    /// Motion end time of this instance
2060    pub motionEndTime: c_float,
2061}
2062
2063unsafe impl Encode for MTLAccelerationStructureMotionInstanceDescriptor {
2064    const ENCODING: Encoding = Encoding::Struct(
2065        "?",
2066        &[
2067            <MTLAccelerationStructureInstanceOptions>::ENCODING,
2068            <u32>::ENCODING,
2069            <u32>::ENCODING,
2070            <u32>::ENCODING,
2071            <u32>::ENCODING,
2072            <u32>::ENCODING,
2073            <u32>::ENCODING,
2074            <MTLMotionBorderMode>::ENCODING,
2075            <MTLMotionBorderMode>::ENCODING,
2076            <c_float>::ENCODING,
2077            <c_float>::ENCODING,
2078        ],
2079    );
2080}
2081
2082unsafe impl RefEncode for MTLAccelerationStructureMotionInstanceDescriptor {
2083    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2084}
2085
2086/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlindirectaccelerationstructureinstancedescriptor?language=objc)
2087#[cfg(all(feature = "MTLAccelerationStructureTypes", feature = "MTLTypes"))]
2088#[repr(C)]
2089#[derive(Clone, Copy, Debug, PartialEq)]
2090pub struct MTLIndirectAccelerationStructureInstanceDescriptor {
2091    /// Transformation matrix describing how to transform the bottom-level acceleration structure.
2092    pub transformationMatrix: MTLPackedFloat4x3,
2093    /// Instance options
2094    pub options: MTLAccelerationStructureInstanceOptions,
2095    /// Instance mask used to ignore geometry during ray tracing
2096    pub mask: u32,
2097    /// Used to index into intersection function tables
2098    pub intersectionFunctionTableOffset: u32,
2099    /// User-assigned instance ID to help identify this instance in an
2100    /// application-defined way
2101    pub userID: u32,
2102    /// Acceleration structure resource handle to use for this instance
2103    pub accelerationStructureID: MTLResourceID,
2104}
2105
2106#[cfg(all(feature = "MTLAccelerationStructureTypes", feature = "MTLTypes"))]
2107unsafe impl Encode for MTLIndirectAccelerationStructureInstanceDescriptor {
2108    const ENCODING: Encoding = Encoding::Struct(
2109        "?",
2110        &[
2111            <MTLPackedFloat4x3>::ENCODING,
2112            <MTLAccelerationStructureInstanceOptions>::ENCODING,
2113            <u32>::ENCODING,
2114            <u32>::ENCODING,
2115            <u32>::ENCODING,
2116            <MTLResourceID>::ENCODING,
2117        ],
2118    );
2119}
2120
2121#[cfg(all(feature = "MTLAccelerationStructureTypes", feature = "MTLTypes"))]
2122unsafe impl RefEncode for MTLIndirectAccelerationStructureInstanceDescriptor {
2123    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2124}
2125
2126/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlindirectaccelerationstructuremotioninstancedescriptor?language=objc)
2127#[cfg(feature = "MTLTypes")]
2128#[repr(C)]
2129#[derive(Clone, Copy, Debug, PartialEq)]
2130pub struct MTLIndirectAccelerationStructureMotionInstanceDescriptor {
2131    /// Instance options
2132    pub options: MTLAccelerationStructureInstanceOptions,
2133    /// Instance mask used to ignore geometry during ray tracing
2134    pub mask: u32,
2135    /// Used to index into intersection function tables
2136    pub intersectionFunctionTableOffset: u32,
2137    /// User-assigned instance ID to help identify this instance in an
2138    /// application-defined way
2139    pub userID: u32,
2140    /// Acceleration structure resource handle to use for this instance
2141    pub accelerationStructureID: MTLResourceID,
2142    /// The index of the first set of transforms describing one keyframe of the animation.
2143    /// These transforms are stored in a separate buffer and they are uniformly distributed over
2144    /// time time span of the motion.
2145    pub motionTransformsStartIndex: u32,
2146    /// The count of motion transforms belonging to this motion which are stored in consecutive
2147    /// memory addresses at the separate motionTransforms buffer.
2148    pub motionTransformsCount: u32,
2149    /// Motion border mode describing what happens if acceleration structure is sampled
2150    /// before motionStartTime
2151    pub motionStartBorderMode: MTLMotionBorderMode,
2152    /// Motion border mode describing what happens if acceleration structure is sampled
2153    /// after motionEndTime
2154    pub motionEndBorderMode: MTLMotionBorderMode,
2155    /// Motion start time of this instance
2156    pub motionStartTime: c_float,
2157    /// Motion end time of this instance
2158    pub motionEndTime: c_float,
2159}
2160
2161#[cfg(feature = "MTLTypes")]
2162unsafe impl Encode for MTLIndirectAccelerationStructureMotionInstanceDescriptor {
2163    const ENCODING: Encoding = Encoding::Struct(
2164        "?",
2165        &[
2166            <MTLAccelerationStructureInstanceOptions>::ENCODING,
2167            <u32>::ENCODING,
2168            <u32>::ENCODING,
2169            <u32>::ENCODING,
2170            <MTLResourceID>::ENCODING,
2171            <u32>::ENCODING,
2172            <u32>::ENCODING,
2173            <MTLMotionBorderMode>::ENCODING,
2174            <MTLMotionBorderMode>::ENCODING,
2175            <c_float>::ENCODING,
2176            <c_float>::ENCODING,
2177        ],
2178    );
2179}
2180
2181#[cfg(feature = "MTLTypes")]
2182unsafe impl RefEncode for MTLIndirectAccelerationStructureMotionInstanceDescriptor {
2183    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2184}
2185
2186/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtltransformtype?language=objc)
2187// NS_ENUM
2188#[repr(transparent)]
2189#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2190pub struct MTLTransformType(pub NSInteger);
2191impl MTLTransformType {
2192    /// A tightly packed matrix with 4 columns and 3 rows. The full transform is assumed
2193    /// to be a 4x4 matrix with the last row being (0, 0, 0, 1).
2194    #[doc(alias = "MTLTransformTypePackedFloat4x3")]
2195    pub const PackedFloat4x3: Self = Self(0);
2196    /// A transformation represented by individual components such as translation and
2197    /// rotation. The rotation is represented by a quaternion, allowing for correct motion
2198    /// interpolation.
2199    #[doc(alias = "MTLTransformTypeComponent")]
2200    pub const Component: Self = Self(1);
2201}
2202
2203unsafe impl Encode for MTLTransformType {
2204    const ENCODING: Encoding = NSInteger::ENCODING;
2205}
2206
2207unsafe impl RefEncode for MTLTransformType {
2208    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2209}
2210
2211extern_class!(
2212    /// Descriptor for an instance acceleration structure
2213    ///
2214    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlinstanceaccelerationstructuredescriptor?language=objc)
2215    #[unsafe(super(MTLAccelerationStructureDescriptor, NSObject))]
2216    #[derive(Debug, PartialEq, Eq, Hash)]
2217    pub struct MTLInstanceAccelerationStructureDescriptor;
2218);
2219
2220extern_conformance!(
2221    unsafe impl NSCopying for MTLInstanceAccelerationStructureDescriptor {}
2222);
2223
2224unsafe impl CopyingHelper for MTLInstanceAccelerationStructureDescriptor {
2225    type Result = Self;
2226}
2227
2228extern_conformance!(
2229    unsafe impl NSObjectProtocol for MTLInstanceAccelerationStructureDescriptor {}
2230);
2231
2232impl MTLInstanceAccelerationStructureDescriptor {
2233    extern_methods!(
2234        #[cfg(all(
2235            feature = "MTLAllocation",
2236            feature = "MTLBuffer",
2237            feature = "MTLResource"
2238        ))]
2239        /// Buffer containing instance descriptors of the type specified by the instanceDescriptorType property
2240        #[unsafe(method(instanceDescriptorBuffer))]
2241        #[unsafe(method_family = none)]
2242        pub fn instanceDescriptorBuffer(&self) -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
2243
2244        #[cfg(all(
2245            feature = "MTLAllocation",
2246            feature = "MTLBuffer",
2247            feature = "MTLResource"
2248        ))]
2249        /// Setter for [`instanceDescriptorBuffer`][Self::instanceDescriptorBuffer].
2250        #[unsafe(method(setInstanceDescriptorBuffer:))]
2251        #[unsafe(method_family = none)]
2252        pub fn setInstanceDescriptorBuffer(
2253            &self,
2254            instance_descriptor_buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
2255        );
2256
2257        /// Offset into the instance descriptor buffer. Must be a multiple of 64 bytes and must be
2258        /// aligned to the platform's buffer offset alignment.
2259        #[unsafe(method(instanceDescriptorBufferOffset))]
2260        #[unsafe(method_family = none)]
2261        pub fn instanceDescriptorBufferOffset(&self) -> NSUInteger;
2262
2263        /// Setter for [`instanceDescriptorBufferOffset`][Self::instanceDescriptorBufferOffset].
2264        ///
2265        /// # Safety
2266        ///
2267        /// This might not be bounds-checked.
2268        #[unsafe(method(setInstanceDescriptorBufferOffset:))]
2269        #[unsafe(method_family = none)]
2270        pub unsafe fn setInstanceDescriptorBufferOffset(
2271            &self,
2272            instance_descriptor_buffer_offset: NSUInteger,
2273        );
2274
2275        /// Stride, in bytes, between instance descriptors in the instance descriptor buffer. Must
2276        /// be at least the size of the instance descriptor type and must be a multiple of 4 bytes.
2277        /// Defaults to the size of the instance descriptor type.
2278        #[unsafe(method(instanceDescriptorStride))]
2279        #[unsafe(method_family = none)]
2280        pub fn instanceDescriptorStride(&self) -> NSUInteger;
2281
2282        /// Setter for [`instanceDescriptorStride`][Self::instanceDescriptorStride].
2283        ///
2284        /// # Safety
2285        ///
2286        /// This might not be bounds-checked.
2287        #[unsafe(method(setInstanceDescriptorStride:))]
2288        #[unsafe(method_family = none)]
2289        pub unsafe fn setInstanceDescriptorStride(&self, instance_descriptor_stride: NSUInteger);
2290
2291        /// Number of instance descriptors
2292        #[unsafe(method(instanceCount))]
2293        #[unsafe(method_family = none)]
2294        pub fn instanceCount(&self) -> NSUInteger;
2295
2296        /// Setter for [`instanceCount`][Self::instanceCount].
2297        #[unsafe(method(setInstanceCount:))]
2298        #[unsafe(method_family = none)]
2299        pub fn setInstanceCount(&self, instance_count: NSUInteger);
2300
2301        #[cfg(all(feature = "MTLAllocation", feature = "MTLResource"))]
2302        /// Acceleration structures to be instanced
2303        #[unsafe(method(instancedAccelerationStructures))]
2304        #[unsafe(method_family = none)]
2305        pub fn instancedAccelerationStructures(
2306            &self,
2307        ) -> Option<Retained<NSArray<ProtocolObject<dyn MTLAccelerationStructure>>>>;
2308
2309        #[cfg(all(feature = "MTLAllocation", feature = "MTLResource"))]
2310        /// Setter for [`instancedAccelerationStructures`][Self::instancedAccelerationStructures].
2311        #[unsafe(method(setInstancedAccelerationStructures:))]
2312        #[unsafe(method_family = none)]
2313        pub fn setInstancedAccelerationStructures(
2314            &self,
2315            instanced_acceleration_structures: Option<
2316                &NSArray<ProtocolObject<dyn MTLAccelerationStructure>>,
2317            >,
2318        );
2319
2320        /// Type of instance descriptor in the instance descriptor buffer. Defaults to
2321        /// MTLAccelerationStructureInstanceDescriptorTypeDefault.
2322        #[unsafe(method(instanceDescriptorType))]
2323        #[unsafe(method_family = none)]
2324        pub fn instanceDescriptorType(&self) -> MTLAccelerationStructureInstanceDescriptorType;
2325
2326        /// Setter for [`instanceDescriptorType`][Self::instanceDescriptorType].
2327        #[unsafe(method(setInstanceDescriptorType:))]
2328        #[unsafe(method_family = none)]
2329        pub fn setInstanceDescriptorType(
2330            &self,
2331            instance_descriptor_type: MTLAccelerationStructureInstanceDescriptorType,
2332        );
2333
2334        #[cfg(all(
2335            feature = "MTLAllocation",
2336            feature = "MTLBuffer",
2337            feature = "MTLResource"
2338        ))]
2339        /// Buffer containing transformation information for motion
2340        #[unsafe(method(motionTransformBuffer))]
2341        #[unsafe(method_family = none)]
2342        pub fn motionTransformBuffer(&self) -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
2343
2344        #[cfg(all(
2345            feature = "MTLAllocation",
2346            feature = "MTLBuffer",
2347            feature = "MTLResource"
2348        ))]
2349        /// Setter for [`motionTransformBuffer`][Self::motionTransformBuffer].
2350        ///
2351        /// # Safety
2352        ///
2353        /// - `motion_transform_buffer` may need to be synchronized.
2354        /// - `motion_transform_buffer` may be unretained, you must ensure it is kept alive while in use.
2355        /// - `motion_transform_buffer` contents should be of the correct type.
2356        #[unsafe(method(setMotionTransformBuffer:))]
2357        #[unsafe(method_family = none)]
2358        pub unsafe fn setMotionTransformBuffer(
2359            &self,
2360            motion_transform_buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
2361        );
2362
2363        /// Offset into the instance motion descriptor buffer. Must be a multiple of 64 bytes and
2364        /// must be aligned to the platform's buffer offset alignment.
2365        #[unsafe(method(motionTransformBufferOffset))]
2366        #[unsafe(method_family = none)]
2367        pub fn motionTransformBufferOffset(&self) -> NSUInteger;
2368
2369        /// Setter for [`motionTransformBufferOffset`][Self::motionTransformBufferOffset].
2370        ///
2371        /// # Safety
2372        ///
2373        /// This might not be bounds-checked.
2374        #[unsafe(method(setMotionTransformBufferOffset:))]
2375        #[unsafe(method_family = none)]
2376        pub unsafe fn setMotionTransformBufferOffset(
2377            &self,
2378            motion_transform_buffer_offset: NSUInteger,
2379        );
2380
2381        /// Number of motion transforms
2382        #[unsafe(method(motionTransformCount))]
2383        #[unsafe(method_family = none)]
2384        pub fn motionTransformCount(&self) -> NSUInteger;
2385
2386        /// Setter for [`motionTransformCount`][Self::motionTransformCount].
2387        ///
2388        /// # Safety
2389        ///
2390        /// This might not be bounds-checked.
2391        #[unsafe(method(setMotionTransformCount:))]
2392        #[unsafe(method_family = none)]
2393        pub unsafe fn setMotionTransformCount(&self, motion_transform_count: NSUInteger);
2394
2395        /// Matrix layout of the transformation matrices in the instance descriptors
2396        /// in the instance descriptor buffer and the transformation matrices in the
2397        /// transformation matrix buffer. Defaults to MTLMatrixLayoutColumnMajor.
2398        #[unsafe(method(instanceTransformationMatrixLayout))]
2399        #[unsafe(method_family = none)]
2400        pub fn instanceTransformationMatrixLayout(&self) -> MTLMatrixLayout;
2401
2402        /// Setter for [`instanceTransformationMatrixLayout`][Self::instanceTransformationMatrixLayout].
2403        #[unsafe(method(setInstanceTransformationMatrixLayout:))]
2404        #[unsafe(method_family = none)]
2405        pub fn setInstanceTransformationMatrixLayout(
2406            &self,
2407            instance_transformation_matrix_layout: MTLMatrixLayout,
2408        );
2409
2410        /// Type of motion transforms. Defaults to MTLTransformTypePackedFloat4x3.
2411        #[unsafe(method(motionTransformType))]
2412        #[unsafe(method_family = none)]
2413        pub fn motionTransformType(&self) -> MTLTransformType;
2414
2415        /// Setter for [`motionTransformType`][Self::motionTransformType].
2416        #[unsafe(method(setMotionTransformType:))]
2417        #[unsafe(method_family = none)]
2418        pub fn setMotionTransformType(&self, motion_transform_type: MTLTransformType);
2419
2420        /// Motion transform stride. Defaults to 0, indicating that transforms are tightly packed according to the
2421        /// motion transform type.
2422        #[unsafe(method(motionTransformStride))]
2423        #[unsafe(method_family = none)]
2424        pub fn motionTransformStride(&self) -> NSUInteger;
2425
2426        /// Setter for [`motionTransformStride`][Self::motionTransformStride].
2427        ///
2428        /// # Safety
2429        ///
2430        /// This might not be bounds-checked.
2431        #[unsafe(method(setMotionTransformStride:))]
2432        #[unsafe(method_family = none)]
2433        pub unsafe fn setMotionTransformStride(&self, motion_transform_stride: NSUInteger);
2434
2435        #[unsafe(method(descriptor))]
2436        #[unsafe(method_family = none)]
2437        pub fn descriptor() -> Retained<Self>;
2438    );
2439}
2440
2441/// Methods declared on superclass `NSObject`.
2442impl MTLInstanceAccelerationStructureDescriptor {
2443    extern_methods!(
2444        #[unsafe(method(init))]
2445        #[unsafe(method_family = init)]
2446        pub fn init(this: Allocated<Self>) -> Retained<Self>;
2447
2448        #[unsafe(method(new))]
2449        #[unsafe(method_family = new)]
2450        pub fn new() -> Retained<Self>;
2451    );
2452}
2453
2454impl DefaultRetained for MTLInstanceAccelerationStructureDescriptor {
2455    #[inline]
2456    fn default_retained() -> Retained<Self> {
2457        Self::new()
2458    }
2459}
2460
2461extern_class!(
2462    /// Descriptor for an instance acceleration structure built with an indirected buffer of instances.
2463    ///
2464    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlindirectinstanceaccelerationstructuredescriptor?language=objc)
2465    #[unsafe(super(MTLAccelerationStructureDescriptor, NSObject))]
2466    #[derive(Debug, PartialEq, Eq, Hash)]
2467    pub struct MTLIndirectInstanceAccelerationStructureDescriptor;
2468);
2469
2470extern_conformance!(
2471    unsafe impl NSCopying for MTLIndirectInstanceAccelerationStructureDescriptor {}
2472);
2473
2474unsafe impl CopyingHelper for MTLIndirectInstanceAccelerationStructureDescriptor {
2475    type Result = Self;
2476}
2477
2478extern_conformance!(
2479    unsafe impl NSObjectProtocol for MTLIndirectInstanceAccelerationStructureDescriptor {}
2480);
2481
2482impl MTLIndirectInstanceAccelerationStructureDescriptor {
2483    extern_methods!(
2484        #[cfg(all(
2485            feature = "MTLAllocation",
2486            feature = "MTLBuffer",
2487            feature = "MTLResource"
2488        ))]
2489        /// Buffer containing instance descriptors of the type specified by the instanceDescriptorType property
2490        #[unsafe(method(instanceDescriptorBuffer))]
2491        #[unsafe(method_family = none)]
2492        pub fn instanceDescriptorBuffer(&self) -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
2493
2494        #[cfg(all(
2495            feature = "MTLAllocation",
2496            feature = "MTLBuffer",
2497            feature = "MTLResource"
2498        ))]
2499        /// Setter for [`instanceDescriptorBuffer`][Self::instanceDescriptorBuffer].
2500        ///
2501        /// # Safety
2502        ///
2503        /// - `instance_descriptor_buffer` may need to be synchronized.
2504        /// - `instance_descriptor_buffer` may be unretained, you must ensure it is kept alive while in use.
2505        /// - `instance_descriptor_buffer` contents should be of the correct type.
2506        #[unsafe(method(setInstanceDescriptorBuffer:))]
2507        #[unsafe(method_family = none)]
2508        pub unsafe fn setInstanceDescriptorBuffer(
2509            &self,
2510            instance_descriptor_buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
2511        );
2512
2513        /// Offset into the instance descriptor buffer. Must be a multiple of 64 bytes and must be
2514        /// aligned to the platform's buffer offset alignment.
2515        #[unsafe(method(instanceDescriptorBufferOffset))]
2516        #[unsafe(method_family = none)]
2517        pub fn instanceDescriptorBufferOffset(&self) -> NSUInteger;
2518
2519        /// Setter for [`instanceDescriptorBufferOffset`][Self::instanceDescriptorBufferOffset].
2520        ///
2521        /// # Safety
2522        ///
2523        /// This might not be bounds-checked.
2524        #[unsafe(method(setInstanceDescriptorBufferOffset:))]
2525        #[unsafe(method_family = none)]
2526        pub unsafe fn setInstanceDescriptorBufferOffset(
2527            &self,
2528            instance_descriptor_buffer_offset: NSUInteger,
2529        );
2530
2531        /// Stride, in bytes, between instance descriptors in the instance descriptor buffer. Must
2532        /// be at least the size of the instance descriptor type and must be a multiple of 4 bytes.
2533        /// Defaults to the size of the instance descriptor type.
2534        #[unsafe(method(instanceDescriptorStride))]
2535        #[unsafe(method_family = none)]
2536        pub fn instanceDescriptorStride(&self) -> NSUInteger;
2537
2538        /// Setter for [`instanceDescriptorStride`][Self::instanceDescriptorStride].
2539        ///
2540        /// # Safety
2541        ///
2542        /// This might not be bounds-checked.
2543        #[unsafe(method(setInstanceDescriptorStride:))]
2544        #[unsafe(method_family = none)]
2545        pub unsafe fn setInstanceDescriptorStride(&self, instance_descriptor_stride: NSUInteger);
2546
2547        /// Maximum number of instance descriptors
2548        #[unsafe(method(maxInstanceCount))]
2549        #[unsafe(method_family = none)]
2550        pub fn maxInstanceCount(&self) -> NSUInteger;
2551
2552        /// Setter for [`maxInstanceCount`][Self::maxInstanceCount].
2553        ///
2554        /// # Safety
2555        ///
2556        /// This might not be bounds-checked.
2557        #[unsafe(method(setMaxInstanceCount:))]
2558        #[unsafe(method_family = none)]
2559        pub unsafe fn setMaxInstanceCount(&self, max_instance_count: NSUInteger);
2560
2561        #[cfg(all(
2562            feature = "MTLAllocation",
2563            feature = "MTLBuffer",
2564            feature = "MTLResource"
2565        ))]
2566        /// Buffer containing the instance count as a uint32_t value. Value at build time
2567        /// must be less than or equal to maxInstanceCount.
2568        #[unsafe(method(instanceCountBuffer))]
2569        #[unsafe(method_family = none)]
2570        pub fn instanceCountBuffer(&self) -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
2571
2572        #[cfg(all(
2573            feature = "MTLAllocation",
2574            feature = "MTLBuffer",
2575            feature = "MTLResource"
2576        ))]
2577        /// Setter for [`instanceCountBuffer`][Self::instanceCountBuffer].
2578        ///
2579        /// # Safety
2580        ///
2581        /// - `instance_count_buffer` may need to be synchronized.
2582        /// - `instance_count_buffer` may be unretained, you must ensure it is kept alive while in use.
2583        /// - `instance_count_buffer` contents should be of the correct type.
2584        #[unsafe(method(setInstanceCountBuffer:))]
2585        #[unsafe(method_family = none)]
2586        pub unsafe fn setInstanceCountBuffer(
2587            &self,
2588            instance_count_buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
2589        );
2590
2591        /// Offset into the instance count buffer. Must be a multiple of 4 bytes and must be
2592        /// aligned to the platform's buffer offset alignment.
2593        #[unsafe(method(instanceCountBufferOffset))]
2594        #[unsafe(method_family = none)]
2595        pub fn instanceCountBufferOffset(&self) -> NSUInteger;
2596
2597        /// Setter for [`instanceCountBufferOffset`][Self::instanceCountBufferOffset].
2598        ///
2599        /// # Safety
2600        ///
2601        /// This might not be bounds-checked.
2602        #[unsafe(method(setInstanceCountBufferOffset:))]
2603        #[unsafe(method_family = none)]
2604        pub unsafe fn setInstanceCountBufferOffset(&self, instance_count_buffer_offset: NSUInteger);
2605
2606        /// Type of instance descriptor in the instance descriptor buffer. Defaults to
2607        /// MTLAccelerationStructureInstanceDescriptorTypeIndirect. Must be
2608        /// MTLAccelerationStructureInstanceDescriptorTypeIndirect or
2609        /// MTLAccelerationStructureInstanceDescriptorTypeIndirectMotion.
2610        #[unsafe(method(instanceDescriptorType))]
2611        #[unsafe(method_family = none)]
2612        pub fn instanceDescriptorType(&self) -> MTLAccelerationStructureInstanceDescriptorType;
2613
2614        /// Setter for [`instanceDescriptorType`][Self::instanceDescriptorType].
2615        #[unsafe(method(setInstanceDescriptorType:))]
2616        #[unsafe(method_family = none)]
2617        pub fn setInstanceDescriptorType(
2618            &self,
2619            instance_descriptor_type: MTLAccelerationStructureInstanceDescriptorType,
2620        );
2621
2622        #[cfg(all(
2623            feature = "MTLAllocation",
2624            feature = "MTLBuffer",
2625            feature = "MTLResource"
2626        ))]
2627        /// Buffer containing transformation information for motion
2628        #[unsafe(method(motionTransformBuffer))]
2629        #[unsafe(method_family = none)]
2630        pub fn motionTransformBuffer(&self) -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
2631
2632        #[cfg(all(
2633            feature = "MTLAllocation",
2634            feature = "MTLBuffer",
2635            feature = "MTLResource"
2636        ))]
2637        /// Setter for [`motionTransformBuffer`][Self::motionTransformBuffer].
2638        ///
2639        /// # Safety
2640        ///
2641        /// - `motion_transform_buffer` may need to be synchronized.
2642        /// - `motion_transform_buffer` may be unretained, you must ensure it is kept alive while in use.
2643        /// - `motion_transform_buffer` contents should be of the correct type.
2644        #[unsafe(method(setMotionTransformBuffer:))]
2645        #[unsafe(method_family = none)]
2646        pub unsafe fn setMotionTransformBuffer(
2647            &self,
2648            motion_transform_buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
2649        );
2650
2651        /// Offset into the instance motion descriptor buffer. Must be a multiple of 64 bytes and
2652        /// must be aligned to the platform's buffer offset alignment.
2653        #[unsafe(method(motionTransformBufferOffset))]
2654        #[unsafe(method_family = none)]
2655        pub fn motionTransformBufferOffset(&self) -> NSUInteger;
2656
2657        /// Setter for [`motionTransformBufferOffset`][Self::motionTransformBufferOffset].
2658        ///
2659        /// # Safety
2660        ///
2661        /// This might not be bounds-checked.
2662        #[unsafe(method(setMotionTransformBufferOffset:))]
2663        #[unsafe(method_family = none)]
2664        pub unsafe fn setMotionTransformBufferOffset(
2665            &self,
2666            motion_transform_buffer_offset: NSUInteger,
2667        );
2668
2669        /// Maximum number of motion transforms
2670        #[unsafe(method(maxMotionTransformCount))]
2671        #[unsafe(method_family = none)]
2672        pub fn maxMotionTransformCount(&self) -> NSUInteger;
2673
2674        /// Setter for [`maxMotionTransformCount`][Self::maxMotionTransformCount].
2675        ///
2676        /// # Safety
2677        ///
2678        /// This might not be bounds-checked.
2679        #[unsafe(method(setMaxMotionTransformCount:))]
2680        #[unsafe(method_family = none)]
2681        pub unsafe fn setMaxMotionTransformCount(&self, max_motion_transform_count: NSUInteger);
2682
2683        #[cfg(all(
2684            feature = "MTLAllocation",
2685            feature = "MTLBuffer",
2686            feature = "MTLResource"
2687        ))]
2688        /// Buffer containing the motion transform count as a uint32_t value. Value at build time
2689        /// must be less than or equal to maxMotionTransformCount.
2690        #[unsafe(method(motionTransformCountBuffer))]
2691        #[unsafe(method_family = none)]
2692        pub fn motionTransformCountBuffer(&self)
2693            -> Option<Retained<ProtocolObject<dyn MTLBuffer>>>;
2694
2695        #[cfg(all(
2696            feature = "MTLAllocation",
2697            feature = "MTLBuffer",
2698            feature = "MTLResource"
2699        ))]
2700        /// Setter for [`motionTransformCountBuffer`][Self::motionTransformCountBuffer].
2701        ///
2702        /// # Safety
2703        ///
2704        /// - `motion_transform_count_buffer` may need to be synchronized.
2705        /// - `motion_transform_count_buffer` may be unretained, you must ensure it is kept alive while in use.
2706        /// - `motion_transform_count_buffer` contents should be of the correct type.
2707        #[unsafe(method(setMotionTransformCountBuffer:))]
2708        #[unsafe(method_family = none)]
2709        pub unsafe fn setMotionTransformCountBuffer(
2710            &self,
2711            motion_transform_count_buffer: Option<&ProtocolObject<dyn MTLBuffer>>,
2712        );
2713
2714        /// Offset into the motion transform count buffer. Must be a multiple of 4 bytes and must be
2715        /// aligned to the platform's buffer offset alignment.
2716        #[unsafe(method(motionTransformCountBufferOffset))]
2717        #[unsafe(method_family = none)]
2718        pub fn motionTransformCountBufferOffset(&self) -> NSUInteger;
2719
2720        /// Setter for [`motionTransformCountBufferOffset`][Self::motionTransformCountBufferOffset].
2721        ///
2722        /// # Safety
2723        ///
2724        /// This might not be bounds-checked.
2725        #[unsafe(method(setMotionTransformCountBufferOffset:))]
2726        #[unsafe(method_family = none)]
2727        pub unsafe fn setMotionTransformCountBufferOffset(
2728            &self,
2729            motion_transform_count_buffer_offset: NSUInteger,
2730        );
2731
2732        /// Matrix layout of the transformation matrices in the instance descriptors
2733        /// in the instance descriptor buffer and the transformation matrices in the
2734        /// transformation matrix buffer. Defaults to MTLMatrixLayoutColumnMajor.
2735        #[unsafe(method(instanceTransformationMatrixLayout))]
2736        #[unsafe(method_family = none)]
2737        pub fn instanceTransformationMatrixLayout(&self) -> MTLMatrixLayout;
2738
2739        /// Setter for [`instanceTransformationMatrixLayout`][Self::instanceTransformationMatrixLayout].
2740        #[unsafe(method(setInstanceTransformationMatrixLayout:))]
2741        #[unsafe(method_family = none)]
2742        pub fn setInstanceTransformationMatrixLayout(
2743            &self,
2744            instance_transformation_matrix_layout: MTLMatrixLayout,
2745        );
2746
2747        /// Type of motion transforms. Defaults to MTLTransformTypePackedFloat4x3.
2748        #[unsafe(method(motionTransformType))]
2749        #[unsafe(method_family = none)]
2750        pub fn motionTransformType(&self) -> MTLTransformType;
2751
2752        /// Setter for [`motionTransformType`][Self::motionTransformType].
2753        #[unsafe(method(setMotionTransformType:))]
2754        #[unsafe(method_family = none)]
2755        pub fn setMotionTransformType(&self, motion_transform_type: MTLTransformType);
2756
2757        /// Motion transform stride. Defaults to 0, indicating that transforms are tightly packed according to the
2758        /// motion transform type.
2759        #[unsafe(method(motionTransformStride))]
2760        #[unsafe(method_family = none)]
2761        pub fn motionTransformStride(&self) -> NSUInteger;
2762
2763        /// Setter for [`motionTransformStride`][Self::motionTransformStride].
2764        ///
2765        /// # Safety
2766        ///
2767        /// This might not be bounds-checked.
2768        #[unsafe(method(setMotionTransformStride:))]
2769        #[unsafe(method_family = none)]
2770        pub unsafe fn setMotionTransformStride(&self, motion_transform_stride: NSUInteger);
2771
2772        #[unsafe(method(descriptor))]
2773        #[unsafe(method_family = none)]
2774        pub fn descriptor() -> Retained<Self>;
2775    );
2776}
2777
2778/// Methods declared on superclass `NSObject`.
2779impl MTLIndirectInstanceAccelerationStructureDescriptor {
2780    extern_methods!(
2781        #[unsafe(method(init))]
2782        #[unsafe(method_family = init)]
2783        pub fn init(this: Allocated<Self>) -> Retained<Self>;
2784
2785        #[unsafe(method(new))]
2786        #[unsafe(method_family = new)]
2787        pub fn new() -> Retained<Self>;
2788    );
2789}
2790
2791impl DefaultRetained for MTLIndirectInstanceAccelerationStructureDescriptor {
2792    #[inline]
2793    fn default_retained() -> Retained<Self> {
2794        Self::new()
2795    }
2796}
2797
2798extern_protocol!(
2799    /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlaccelerationstructure?language=objc)
2800    #[cfg(all(feature = "MTLAllocation", feature = "MTLResource"))]
2801    pub unsafe trait MTLAccelerationStructure: MTLResource {
2802        #[unsafe(method(size))]
2803        #[unsafe(method_family = none)]
2804        fn size(&self) -> NSUInteger;
2805
2806        #[cfg(feature = "MTLTypes")]
2807        /// Handle of the GPU resource suitable for storing in an Argument Buffer
2808        #[unsafe(method(gpuResourceID))]
2809        #[unsafe(method_family = none)]
2810        fn gpuResourceID(&self) -> MTLResourceID;
2811    }
2812);