objc2_metal_performance_shaders/generated/MPSRayIntersector/
MPSQuadrilateralAccelerationStructure.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::*;
7use objc2_metal::*;
8
9use crate::*;
10
11extern_class!(
12    /// An acceleration structure built over quadrilaterals
13    ///
14    ///
15    /// See MPSPolygonAccelerationStructure for more information
16    ///
17    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsquadrilateralaccelerationstructure?language=objc)
18    #[unsafe(super(
19        MPSPolygonAccelerationStructure,
20        MPSAccelerationStructure,
21        MPSKernel,
22        NSObject
23    ))]
24    #[derive(Debug, PartialEq, Eq, Hash)]
25    #[cfg(all(
26        feature = "MPSAccelerationStructure",
27        feature = "MPSCore",
28        feature = "MPSKernel",
29        feature = "MPSPolygonAccelerationStructure"
30    ))]
31    #[deprecated]
32    pub struct MPSQuadrilateralAccelerationStructure;
33);
34
35#[cfg(all(
36    feature = "MPSAccelerationStructure",
37    feature = "MPSCore",
38    feature = "MPSKernel",
39    feature = "MPSPolygonAccelerationStructure"
40))]
41extern_conformance!(
42    unsafe impl NSCoding for MPSQuadrilateralAccelerationStructure {}
43);
44
45#[cfg(all(
46    feature = "MPSAccelerationStructure",
47    feature = "MPSCore",
48    feature = "MPSKernel",
49    feature = "MPSPolygonAccelerationStructure"
50))]
51extern_conformance!(
52    unsafe impl NSCopying for MPSQuadrilateralAccelerationStructure {}
53);
54
55#[cfg(all(
56    feature = "MPSAccelerationStructure",
57    feature = "MPSCore",
58    feature = "MPSKernel",
59    feature = "MPSPolygonAccelerationStructure"
60))]
61unsafe impl CopyingHelper for MPSQuadrilateralAccelerationStructure {
62    type Result = Self;
63}
64
65#[cfg(all(
66    feature = "MPSAccelerationStructure",
67    feature = "MPSCore",
68    feature = "MPSKernel",
69    feature = "MPSPolygonAccelerationStructure"
70))]
71extern_conformance!(
72    unsafe impl NSObjectProtocol for MPSQuadrilateralAccelerationStructure {}
73);
74
75#[cfg(all(
76    feature = "MPSAccelerationStructure",
77    feature = "MPSCore",
78    feature = "MPSKernel",
79    feature = "MPSPolygonAccelerationStructure"
80))]
81extern_conformance!(
82    unsafe impl NSSecureCoding for MPSQuadrilateralAccelerationStructure {}
83);
84
85#[cfg(all(
86    feature = "MPSAccelerationStructure",
87    feature = "MPSCore",
88    feature = "MPSKernel",
89    feature = "MPSPolygonAccelerationStructure"
90))]
91impl MPSQuadrilateralAccelerationStructure {
92    extern_methods!(
93        /// Number of quads. Changes to this property require rebuilding the acceleration
94        /// structure. This is an alias for the polygonCount property.
95        #[deprecated]
96        #[unsafe(method(quadrilateralCount))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn quadrilateralCount(&self) -> NSUInteger;
99
100        /// Setter for [`quadrilateralCount`][Self::quadrilateralCount].
101        #[deprecated]
102        #[unsafe(method(setQuadrilateralCount:))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn setQuadrilateralCount(&self, quadrilateral_count: NSUInteger);
105    );
106}
107
108/// Methods declared on superclass `MPSAccelerationStructure`.
109#[cfg(all(
110    feature = "MPSAccelerationStructure",
111    feature = "MPSCore",
112    feature = "MPSKernel",
113    feature = "MPSPolygonAccelerationStructure"
114))]
115impl MPSQuadrilateralAccelerationStructure {
116    extern_methods!(
117        #[deprecated]
118        #[unsafe(method(init))]
119        #[unsafe(method_family = init)]
120        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
121
122        /// Initialize the acceleration structure with a Metal device
123        #[deprecated]
124        #[unsafe(method(initWithDevice:))]
125        #[unsafe(method_family = init)]
126        pub unsafe fn initWithDevice(
127            this: Allocated<Self>,
128            device: &ProtocolObject<dyn MTLDevice>,
129        ) -> Retained<Self>;
130
131        /// Initialize the acceleration structure with an NSCoder and a Metal device. Buffer
132        /// properties such as the vertex buffer, instance buffer, etc. are set to nil. Encode and decode
133        /// these buffers along with the acceleration structure instead.
134        ///
135        /// # Safety
136        ///
137        /// `a_decoder` possibly has further requirements.
138        #[deprecated]
139        #[unsafe(method(initWithCoder:device:))]
140        #[unsafe(method_family = init)]
141        pub unsafe fn initWithCoder_device(
142            this: Allocated<Self>,
143            a_decoder: &NSCoder,
144            device: &ProtocolObject<dyn MTLDevice>,
145        ) -> Option<Retained<Self>>;
146
147        #[cfg(feature = "MPSAccelerationStructureGroup")]
148        /// Initialize the acceleration structure with an acceleration structure group, if the
149        /// acceleration structure will be used in an instance hierarchy.
150        ///
151        ///
152        /// The Metal device is determined from the acceleration structure group. All
153        /// acceleration structures in the instance hierarchy must share the same group.
154        #[deprecated]
155        #[unsafe(method(initWithGroup:))]
156        #[unsafe(method_family = init)]
157        pub unsafe fn initWithGroup(
158            this: Allocated<Self>,
159            group: &MPSAccelerationStructureGroup,
160        ) -> Retained<Self>;
161
162        #[cfg(feature = "MPSAccelerationStructureGroup")]
163        /// Initialize the acceleration structure with an NSCoder and an acceleration structure
164        /// group, if the acceleration structure will be used in an instance hierarchy. All acceleration
165        /// structures in the instance hierarchy must share the same group. Buffer properties such as the
166        /// vertex buffer, instance buffer, etc. are set to nil. Encode and decode these buffers along with
167        /// the acceleration structure instead.
168        ///
169        /// # Safety
170        ///
171        /// `a_decoder` possibly has further requirements.
172        #[deprecated]
173        #[unsafe(method(initWithCoder:group:))]
174        #[unsafe(method_family = init)]
175        pub unsafe fn initWithCoder_group(
176            this: Allocated<Self>,
177            a_decoder: &NSCoder,
178            group: &MPSAccelerationStructureGroup,
179        ) -> Option<Retained<Self>>;
180    );
181}
182
183/// Methods declared on superclass `MPSKernel`.
184#[cfg(all(
185    feature = "MPSAccelerationStructure",
186    feature = "MPSCore",
187    feature = "MPSKernel",
188    feature = "MPSPolygonAccelerationStructure"
189))]
190impl MPSQuadrilateralAccelerationStructure {
191    extern_methods!(
192        /// Called by NSCoder to decode MPSKernels
193        ///
194        /// This isn't the right interface to decode a MPSKernel, but
195        /// it is the one that NSCoder uses. To enable your NSCoder
196        /// (e.g. NSKeyedUnarchiver) to set which device to use
197        /// extend the object to adopt the MPSDeviceProvider
198        /// protocol. Otherwise, the Metal system default device
199        /// will be used.
200        ///
201        /// # Safety
202        ///
203        /// `a_decoder` possibly has further requirements.
204        #[unsafe(method(initWithCoder:))]
205        #[unsafe(method_family = init)]
206        pub unsafe fn initWithCoder(
207            this: Allocated<Self>,
208            a_decoder: &NSCoder,
209        ) -> Option<Retained<Self>>;
210    );
211}
212
213/// Methods declared on superclass `NSObject`.
214#[cfg(all(
215    feature = "MPSAccelerationStructure",
216    feature = "MPSCore",
217    feature = "MPSKernel",
218    feature = "MPSPolygonAccelerationStructure"
219))]
220impl MPSQuadrilateralAccelerationStructure {
221    extern_methods!(
222        #[unsafe(method(new))]
223        #[unsafe(method_family = new)]
224        pub unsafe fn new() -> Retained<Self>;
225    );
226}