objc2_metal_performance_shaders/generated/MPSRayIntersector/
MPSTriangleAccelerationStructure.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 triangles
13    ///
14    ///
15    /// See MPSPolygonAccelerationStructure for more information
16    ///
17    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpstriangleaccelerationstructure?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 MPSTriangleAccelerationStructure;
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 MPSTriangleAccelerationStructure {}
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 MPSTriangleAccelerationStructure {}
53);
54
55#[cfg(all(
56    feature = "MPSAccelerationStructure",
57    feature = "MPSCore",
58    feature = "MPSKernel",
59    feature = "MPSPolygonAccelerationStructure"
60))]
61unsafe impl CopyingHelper for MPSTriangleAccelerationStructure {
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 MPSTriangleAccelerationStructure {}
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 MPSTriangleAccelerationStructure {}
83);
84
85#[cfg(all(
86    feature = "MPSAccelerationStructure",
87    feature = "MPSCore",
88    feature = "MPSKernel",
89    feature = "MPSPolygonAccelerationStructure"
90))]
91impl MPSTriangleAccelerationStructure {
92    extern_methods!(
93        /// Number of triangles. Changes to this property require rebuilding the acceleration
94        /// structure.
95        ///
96        /// Note that this property is an alias for the polygonCount property.
97        #[deprecated]
98        #[unsafe(method(triangleCount))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn triangleCount(&self) -> NSUInteger;
101
102        /// Setter for [`triangleCount`][Self::triangleCount].
103        #[deprecated]
104        #[unsafe(method(setTriangleCount:))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn setTriangleCount(&self, triangle_count: NSUInteger);
107    );
108}
109
110/// Methods declared on superclass `MPSAccelerationStructure`.
111#[cfg(all(
112    feature = "MPSAccelerationStructure",
113    feature = "MPSCore",
114    feature = "MPSKernel",
115    feature = "MPSPolygonAccelerationStructure"
116))]
117impl MPSTriangleAccelerationStructure {
118    extern_methods!(
119        #[deprecated]
120        #[unsafe(method(init))]
121        #[unsafe(method_family = init)]
122        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
123
124        /// Initialize the acceleration structure with a Metal device
125        #[deprecated]
126        #[unsafe(method(initWithDevice:))]
127        #[unsafe(method_family = init)]
128        pub unsafe fn initWithDevice(
129            this: Allocated<Self>,
130            device: &ProtocolObject<dyn MTLDevice>,
131        ) -> Retained<Self>;
132
133        /// Initialize the acceleration structure with an NSCoder and a Metal device. Buffer
134        /// properties such as the vertex buffer, instance buffer, etc. are set to nil. Encode and decode
135        /// these buffers along with the acceleration structure instead.
136        ///
137        /// # Safety
138        ///
139        /// `a_decoder` possibly has further requirements.
140        #[deprecated]
141        #[unsafe(method(initWithCoder:device:))]
142        #[unsafe(method_family = init)]
143        pub unsafe fn initWithCoder_device(
144            this: Allocated<Self>,
145            a_decoder: &NSCoder,
146            device: &ProtocolObject<dyn MTLDevice>,
147        ) -> Option<Retained<Self>>;
148
149        #[cfg(feature = "MPSAccelerationStructureGroup")]
150        /// Initialize the acceleration structure with an acceleration structure group, if the
151        /// acceleration structure will be used in an instance hierarchy.
152        ///
153        ///
154        /// The Metal device is determined from the acceleration structure group. All
155        /// acceleration structures in the instance hierarchy must share the same group.
156        #[deprecated]
157        #[unsafe(method(initWithGroup:))]
158        #[unsafe(method_family = init)]
159        pub unsafe fn initWithGroup(
160            this: Allocated<Self>,
161            group: &MPSAccelerationStructureGroup,
162        ) -> Retained<Self>;
163
164        #[cfg(feature = "MPSAccelerationStructureGroup")]
165        /// Initialize the acceleration structure with an NSCoder and an acceleration structure
166        /// group, if the acceleration structure will be used in an instance hierarchy. All acceleration
167        /// structures in the instance hierarchy must share the same group. Buffer properties such as the
168        /// vertex buffer, instance buffer, etc. are set to nil. Encode and decode these buffers along with
169        /// the acceleration structure instead.
170        ///
171        /// # Safety
172        ///
173        /// `a_decoder` possibly has further requirements.
174        #[deprecated]
175        #[unsafe(method(initWithCoder:group:))]
176        #[unsafe(method_family = init)]
177        pub unsafe fn initWithCoder_group(
178            this: Allocated<Self>,
179            a_decoder: &NSCoder,
180            group: &MPSAccelerationStructureGroup,
181        ) -> Option<Retained<Self>>;
182    );
183}
184
185/// Methods declared on superclass `MPSKernel`.
186#[cfg(all(
187    feature = "MPSAccelerationStructure",
188    feature = "MPSCore",
189    feature = "MPSKernel",
190    feature = "MPSPolygonAccelerationStructure"
191))]
192impl MPSTriangleAccelerationStructure {
193    extern_methods!(
194        /// Called by NSCoder to decode MPSKernels
195        ///
196        /// This isn't the right interface to decode a MPSKernel, but
197        /// it is the one that NSCoder uses. To enable your NSCoder
198        /// (e.g. NSKeyedUnarchiver) to set which device to use
199        /// extend the object to adopt the MPSDeviceProvider
200        /// protocol. Otherwise, the Metal system default device
201        /// will be used.
202        ///
203        /// # Safety
204        ///
205        /// `a_decoder` possibly has further requirements.
206        #[unsafe(method(initWithCoder:))]
207        #[unsafe(method_family = init)]
208        pub unsafe fn initWithCoder(
209            this: Allocated<Self>,
210            a_decoder: &NSCoder,
211        ) -> Option<Retained<Self>>;
212    );
213}
214
215/// Methods declared on superclass `NSObject`.
216#[cfg(all(
217    feature = "MPSAccelerationStructure",
218    feature = "MPSCore",
219    feature = "MPSKernel",
220    feature = "MPSPolygonAccelerationStructure"
221))]
222impl MPSTriangleAccelerationStructure {
223    extern_methods!(
224        #[unsafe(method(new))]
225        #[unsafe(method_family = new)]
226        pub unsafe fn new() -> Retained<Self>;
227    );
228}