objc2_metal/generated/
MTLStageInputOutputDescriptor.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/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlattributeformat?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct MTLAttributeFormat(pub NSUInteger);
15impl MTLAttributeFormat {
16    #[doc(alias = "MTLAttributeFormatInvalid")]
17    pub const Invalid: Self = Self(0);
18    #[doc(alias = "MTLAttributeFormatUChar2")]
19    pub const UChar2: Self = Self(1);
20    #[doc(alias = "MTLAttributeFormatUChar3")]
21    pub const UChar3: Self = Self(2);
22    #[doc(alias = "MTLAttributeFormatUChar4")]
23    pub const UChar4: Self = Self(3);
24    #[doc(alias = "MTLAttributeFormatChar2")]
25    pub const Char2: Self = Self(4);
26    #[doc(alias = "MTLAttributeFormatChar3")]
27    pub const Char3: Self = Self(5);
28    #[doc(alias = "MTLAttributeFormatChar4")]
29    pub const Char4: Self = Self(6);
30    #[doc(alias = "MTLAttributeFormatUChar2Normalized")]
31    pub const UChar2Normalized: Self = Self(7);
32    #[doc(alias = "MTLAttributeFormatUChar3Normalized")]
33    pub const UChar3Normalized: Self = Self(8);
34    #[doc(alias = "MTLAttributeFormatUChar4Normalized")]
35    pub const UChar4Normalized: Self = Self(9);
36    #[doc(alias = "MTLAttributeFormatChar2Normalized")]
37    pub const Char2Normalized: Self = Self(10);
38    #[doc(alias = "MTLAttributeFormatChar3Normalized")]
39    pub const Char3Normalized: Self = Self(11);
40    #[doc(alias = "MTLAttributeFormatChar4Normalized")]
41    pub const Char4Normalized: Self = Self(12);
42    #[doc(alias = "MTLAttributeFormatUShort2")]
43    pub const UShort2: Self = Self(13);
44    #[doc(alias = "MTLAttributeFormatUShort3")]
45    pub const UShort3: Self = Self(14);
46    #[doc(alias = "MTLAttributeFormatUShort4")]
47    pub const UShort4: Self = Self(15);
48    #[doc(alias = "MTLAttributeFormatShort2")]
49    pub const Short2: Self = Self(16);
50    #[doc(alias = "MTLAttributeFormatShort3")]
51    pub const Short3: Self = Self(17);
52    #[doc(alias = "MTLAttributeFormatShort4")]
53    pub const Short4: Self = Self(18);
54    #[doc(alias = "MTLAttributeFormatUShort2Normalized")]
55    pub const UShort2Normalized: Self = Self(19);
56    #[doc(alias = "MTLAttributeFormatUShort3Normalized")]
57    pub const UShort3Normalized: Self = Self(20);
58    #[doc(alias = "MTLAttributeFormatUShort4Normalized")]
59    pub const UShort4Normalized: Self = Self(21);
60    #[doc(alias = "MTLAttributeFormatShort2Normalized")]
61    pub const Short2Normalized: Self = Self(22);
62    #[doc(alias = "MTLAttributeFormatShort3Normalized")]
63    pub const Short3Normalized: Self = Self(23);
64    #[doc(alias = "MTLAttributeFormatShort4Normalized")]
65    pub const Short4Normalized: Self = Self(24);
66    #[doc(alias = "MTLAttributeFormatHalf2")]
67    pub const Half2: Self = Self(25);
68    #[doc(alias = "MTLAttributeFormatHalf3")]
69    pub const Half3: Self = Self(26);
70    #[doc(alias = "MTLAttributeFormatHalf4")]
71    pub const Half4: Self = Self(27);
72    #[doc(alias = "MTLAttributeFormatFloat")]
73    pub const Float: Self = Self(28);
74    #[doc(alias = "MTLAttributeFormatFloat2")]
75    pub const Float2: Self = Self(29);
76    #[doc(alias = "MTLAttributeFormatFloat3")]
77    pub const Float3: Self = Self(30);
78    #[doc(alias = "MTLAttributeFormatFloat4")]
79    pub const Float4: Self = Self(31);
80    #[doc(alias = "MTLAttributeFormatInt")]
81    pub const Int: Self = Self(32);
82    #[doc(alias = "MTLAttributeFormatInt2")]
83    pub const Int2: Self = Self(33);
84    #[doc(alias = "MTLAttributeFormatInt3")]
85    pub const Int3: Self = Self(34);
86    #[doc(alias = "MTLAttributeFormatInt4")]
87    pub const Int4: Self = Self(35);
88    #[doc(alias = "MTLAttributeFormatUInt")]
89    pub const UInt: Self = Self(36);
90    #[doc(alias = "MTLAttributeFormatUInt2")]
91    pub const UInt2: Self = Self(37);
92    #[doc(alias = "MTLAttributeFormatUInt3")]
93    pub const UInt3: Self = Self(38);
94    #[doc(alias = "MTLAttributeFormatUInt4")]
95    pub const UInt4: Self = Self(39);
96    #[doc(alias = "MTLAttributeFormatInt1010102Normalized")]
97    pub const Int1010102Normalized: Self = Self(40);
98    #[doc(alias = "MTLAttributeFormatUInt1010102Normalized")]
99    pub const UInt1010102Normalized: Self = Self(41);
100    #[doc(alias = "MTLAttributeFormatUChar4Normalized_BGRA")]
101    pub const UChar4Normalized_BGRA: Self = Self(42);
102    #[doc(alias = "MTLAttributeFormatUChar")]
103    pub const UChar: Self = Self(45);
104    #[doc(alias = "MTLAttributeFormatChar")]
105    pub const Char: Self = Self(46);
106    #[doc(alias = "MTLAttributeFormatUCharNormalized")]
107    pub const UCharNormalized: Self = Self(47);
108    #[doc(alias = "MTLAttributeFormatCharNormalized")]
109    pub const CharNormalized: Self = Self(48);
110    #[doc(alias = "MTLAttributeFormatUShort")]
111    pub const UShort: Self = Self(49);
112    #[doc(alias = "MTLAttributeFormatShort")]
113    pub const Short: Self = Self(50);
114    #[doc(alias = "MTLAttributeFormatUShortNormalized")]
115    pub const UShortNormalized: Self = Self(51);
116    #[doc(alias = "MTLAttributeFormatShortNormalized")]
117    pub const ShortNormalized: Self = Self(52);
118    #[doc(alias = "MTLAttributeFormatHalf")]
119    pub const Half: Self = Self(53);
120    #[doc(alias = "MTLAttributeFormatFloatRG11B10")]
121    pub const FloatRG11B10: Self = Self(54);
122    #[doc(alias = "MTLAttributeFormatFloatRGB9E5")]
123    pub const FloatRGB9E5: Self = Self(55);
124}
125
126unsafe impl Encode for MTLAttributeFormat {
127    const ENCODING: Encoding = NSUInteger::ENCODING;
128}
129
130unsafe impl RefEncode for MTLAttributeFormat {
131    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
132}
133
134/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlstepfunction?language=objc)
135// NS_ENUM
136#[repr(transparent)]
137#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
138pub struct MTLStepFunction(pub NSUInteger);
139impl MTLStepFunction {
140    #[doc(alias = "MTLStepFunctionConstant")]
141    pub const Constant: Self = Self(0);
142    #[doc(alias = "MTLStepFunctionPerVertex")]
143    pub const PerVertex: Self = Self(1);
144    #[doc(alias = "MTLStepFunctionPerInstance")]
145    pub const PerInstance: Self = Self(2);
146    #[doc(alias = "MTLStepFunctionPerPatch")]
147    pub const PerPatch: Self = Self(3);
148    #[doc(alias = "MTLStepFunctionPerPatchControlPoint")]
149    pub const PerPatchControlPoint: Self = Self(4);
150    #[doc(alias = "MTLStepFunctionThreadPositionInGridX")]
151    pub const ThreadPositionInGridX: Self = Self(5);
152    #[doc(alias = "MTLStepFunctionThreadPositionInGridY")]
153    pub const ThreadPositionInGridY: Self = Self(6);
154    #[doc(alias = "MTLStepFunctionThreadPositionInGridXIndexed")]
155    pub const ThreadPositionInGridXIndexed: Self = Self(7);
156    #[doc(alias = "MTLStepFunctionThreadPositionInGridYIndexed")]
157    pub const ThreadPositionInGridYIndexed: Self = Self(8);
158}
159
160unsafe impl Encode for MTLStepFunction {
161    const ENCODING: Encoding = NSUInteger::ENCODING;
162}
163
164unsafe impl RefEncode for MTLStepFunction {
165    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
166}
167
168extern_class!(
169    /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlbufferlayoutdescriptor?language=objc)
170    #[unsafe(super(NSObject))]
171    #[derive(Debug, PartialEq, Eq, Hash)]
172    pub struct MTLBufferLayoutDescriptor;
173);
174
175extern_conformance!(
176    unsafe impl NSCopying for MTLBufferLayoutDescriptor {}
177);
178
179unsafe impl CopyingHelper for MTLBufferLayoutDescriptor {
180    type Result = Self;
181}
182
183extern_conformance!(
184    unsafe impl NSObjectProtocol for MTLBufferLayoutDescriptor {}
185);
186
187impl MTLBufferLayoutDescriptor {
188    extern_methods!(
189        #[unsafe(method(stride))]
190        #[unsafe(method_family = none)]
191        pub fn stride(&self) -> NSUInteger;
192
193        /// Setter for [`stride`][Self::stride].
194        #[unsafe(method(setStride:))]
195        #[unsafe(method_family = none)]
196        pub fn setStride(&self, stride: NSUInteger);
197
198        #[unsafe(method(stepFunction))]
199        #[unsafe(method_family = none)]
200        pub fn stepFunction(&self) -> MTLStepFunction;
201
202        /// Setter for [`stepFunction`][Self::stepFunction].
203        #[unsafe(method(setStepFunction:))]
204        #[unsafe(method_family = none)]
205        pub fn setStepFunction(&self, step_function: MTLStepFunction);
206
207        #[unsafe(method(stepRate))]
208        #[unsafe(method_family = none)]
209        pub fn stepRate(&self) -> NSUInteger;
210
211        /// Setter for [`stepRate`][Self::stepRate].
212        #[unsafe(method(setStepRate:))]
213        #[unsafe(method_family = none)]
214        pub fn setStepRate(&self, step_rate: NSUInteger);
215    );
216}
217
218/// Methods declared on superclass `NSObject`.
219impl MTLBufferLayoutDescriptor {
220    extern_methods!(
221        #[unsafe(method(init))]
222        #[unsafe(method_family = init)]
223        pub fn init(this: Allocated<Self>) -> Retained<Self>;
224
225        #[unsafe(method(new))]
226        #[unsafe(method_family = new)]
227        pub fn new() -> Retained<Self>;
228    );
229}
230
231impl DefaultRetained for MTLBufferLayoutDescriptor {
232    #[inline]
233    fn default_retained() -> Retained<Self> {
234        Self::new()
235    }
236}
237
238extern_class!(
239    /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlbufferlayoutdescriptorarray?language=objc)
240    #[unsafe(super(NSObject))]
241    #[derive(Debug, PartialEq, Eq, Hash)]
242    pub struct MTLBufferLayoutDescriptorArray;
243);
244
245extern_conformance!(
246    unsafe impl NSObjectProtocol for MTLBufferLayoutDescriptorArray {}
247);
248
249impl MTLBufferLayoutDescriptorArray {
250    extern_methods!(
251        /// # Safety
252        ///
253        /// `index` might not be bounds-checked.
254        #[unsafe(method(objectAtIndexedSubscript:))]
255        #[unsafe(method_family = none)]
256        pub unsafe fn objectAtIndexedSubscript(
257            &self,
258            index: NSUInteger,
259        ) -> Retained<MTLBufferLayoutDescriptor>;
260
261        /// # Safety
262        ///
263        /// `index` might not be bounds-checked.
264        #[unsafe(method(setObject:atIndexedSubscript:))]
265        #[unsafe(method_family = none)]
266        pub unsafe fn setObject_atIndexedSubscript(
267            &self,
268            buffer_desc: Option<&MTLBufferLayoutDescriptor>,
269            index: NSUInteger,
270        );
271    );
272}
273
274/// Methods declared on superclass `NSObject`.
275impl MTLBufferLayoutDescriptorArray {
276    extern_methods!(
277        #[unsafe(method(init))]
278        #[unsafe(method_family = init)]
279        pub fn init(this: Allocated<Self>) -> Retained<Self>;
280
281        #[unsafe(method(new))]
282        #[unsafe(method_family = new)]
283        pub fn new() -> Retained<Self>;
284    );
285}
286
287impl DefaultRetained for MTLBufferLayoutDescriptorArray {
288    #[inline]
289    fn default_retained() -> Retained<Self> {
290        Self::new()
291    }
292}
293
294extern_class!(
295    /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlattributedescriptor?language=objc)
296    #[unsafe(super(NSObject))]
297    #[derive(Debug, PartialEq, Eq, Hash)]
298    pub struct MTLAttributeDescriptor;
299);
300
301extern_conformance!(
302    unsafe impl NSCopying for MTLAttributeDescriptor {}
303);
304
305unsafe impl CopyingHelper for MTLAttributeDescriptor {
306    type Result = Self;
307}
308
309extern_conformance!(
310    unsafe impl NSObjectProtocol for MTLAttributeDescriptor {}
311);
312
313impl MTLAttributeDescriptor {
314    extern_methods!(
315        #[unsafe(method(format))]
316        #[unsafe(method_family = none)]
317        pub fn format(&self) -> MTLAttributeFormat;
318
319        /// Setter for [`format`][Self::format].
320        #[unsafe(method(setFormat:))]
321        #[unsafe(method_family = none)]
322        pub fn setFormat(&self, format: MTLAttributeFormat);
323
324        #[unsafe(method(offset))]
325        #[unsafe(method_family = none)]
326        pub fn offset(&self) -> NSUInteger;
327
328        /// Setter for [`offset`][Self::offset].
329        #[unsafe(method(setOffset:))]
330        #[unsafe(method_family = none)]
331        pub fn setOffset(&self, offset: NSUInteger);
332
333        #[unsafe(method(bufferIndex))]
334        #[unsafe(method_family = none)]
335        pub fn bufferIndex(&self) -> NSUInteger;
336
337        /// Setter for [`bufferIndex`][Self::bufferIndex].
338        ///
339        /// # Safety
340        ///
341        /// This might not be bounds-checked.
342        #[unsafe(method(setBufferIndex:))]
343        #[unsafe(method_family = none)]
344        pub unsafe fn setBufferIndex(&self, buffer_index: NSUInteger);
345    );
346}
347
348/// Methods declared on superclass `NSObject`.
349impl MTLAttributeDescriptor {
350    extern_methods!(
351        #[unsafe(method(init))]
352        #[unsafe(method_family = init)]
353        pub fn init(this: Allocated<Self>) -> Retained<Self>;
354
355        #[unsafe(method(new))]
356        #[unsafe(method_family = new)]
357        pub fn new() -> Retained<Self>;
358    );
359}
360
361impl DefaultRetained for MTLAttributeDescriptor {
362    #[inline]
363    fn default_retained() -> Retained<Self> {
364        Self::new()
365    }
366}
367
368extern_class!(
369    /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlattributedescriptorarray?language=objc)
370    #[unsafe(super(NSObject))]
371    #[derive(Debug, PartialEq, Eq, Hash)]
372    pub struct MTLAttributeDescriptorArray;
373);
374
375extern_conformance!(
376    unsafe impl NSObjectProtocol for MTLAttributeDescriptorArray {}
377);
378
379impl MTLAttributeDescriptorArray {
380    extern_methods!(
381        /// # Safety
382        ///
383        /// `index` might not be bounds-checked.
384        #[unsafe(method(objectAtIndexedSubscript:))]
385        #[unsafe(method_family = none)]
386        pub unsafe fn objectAtIndexedSubscript(
387            &self,
388            index: NSUInteger,
389        ) -> Retained<MTLAttributeDescriptor>;
390
391        /// # Safety
392        ///
393        /// `index` might not be bounds-checked.
394        #[unsafe(method(setObject:atIndexedSubscript:))]
395        #[unsafe(method_family = none)]
396        pub unsafe fn setObject_atIndexedSubscript(
397            &self,
398            attribute_desc: Option<&MTLAttributeDescriptor>,
399            index: NSUInteger,
400        );
401    );
402}
403
404/// Methods declared on superclass `NSObject`.
405impl MTLAttributeDescriptorArray {
406    extern_methods!(
407        #[unsafe(method(init))]
408        #[unsafe(method_family = init)]
409        pub fn init(this: Allocated<Self>) -> Retained<Self>;
410
411        #[unsafe(method(new))]
412        #[unsafe(method_family = new)]
413        pub fn new() -> Retained<Self>;
414    );
415}
416
417impl DefaultRetained for MTLAttributeDescriptorArray {
418    #[inline]
419    fn default_retained() -> Retained<Self> {
420        Self::new()
421    }
422}
423
424extern_class!(
425    /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlstageinputoutputdescriptor?language=objc)
426    #[unsafe(super(NSObject))]
427    #[derive(Debug, PartialEq, Eq, Hash)]
428    pub struct MTLStageInputOutputDescriptor;
429);
430
431extern_conformance!(
432    unsafe impl NSCopying for MTLStageInputOutputDescriptor {}
433);
434
435unsafe impl CopyingHelper for MTLStageInputOutputDescriptor {
436    type Result = Self;
437}
438
439extern_conformance!(
440    unsafe impl NSObjectProtocol for MTLStageInputOutputDescriptor {}
441);
442
443impl MTLStageInputOutputDescriptor {
444    extern_methods!(
445        #[unsafe(method(stageInputOutputDescriptor))]
446        #[unsafe(method_family = none)]
447        pub fn stageInputOutputDescriptor() -> Retained<MTLStageInputOutputDescriptor>;
448
449        #[unsafe(method(layouts))]
450        #[unsafe(method_family = none)]
451        pub fn layouts(&self) -> Retained<MTLBufferLayoutDescriptorArray>;
452
453        #[unsafe(method(attributes))]
454        #[unsafe(method_family = none)]
455        pub fn attributes(&self) -> Retained<MTLAttributeDescriptorArray>;
456
457        #[cfg(feature = "MTLArgument")]
458        #[unsafe(method(indexType))]
459        #[unsafe(method_family = none)]
460        pub fn indexType(&self) -> MTLIndexType;
461
462        #[cfg(feature = "MTLArgument")]
463        /// Setter for [`indexType`][Self::indexType].
464        #[unsafe(method(setIndexType:))]
465        #[unsafe(method_family = none)]
466        pub fn setIndexType(&self, index_type: MTLIndexType);
467
468        #[unsafe(method(indexBufferIndex))]
469        #[unsafe(method_family = none)]
470        pub fn indexBufferIndex(&self) -> NSUInteger;
471
472        /// Setter for [`indexBufferIndex`][Self::indexBufferIndex].
473        ///
474        /// # Safety
475        ///
476        /// This might not be bounds-checked.
477        #[unsafe(method(setIndexBufferIndex:))]
478        #[unsafe(method_family = none)]
479        pub unsafe fn setIndexBufferIndex(&self, index_buffer_index: NSUInteger);
480
481        #[unsafe(method(reset))]
482        #[unsafe(method_family = none)]
483        pub fn reset(&self);
484    );
485}
486
487/// Methods declared on superclass `NSObject`.
488impl MTLStageInputOutputDescriptor {
489    extern_methods!(
490        #[unsafe(method(init))]
491        #[unsafe(method_family = init)]
492        pub fn init(this: Allocated<Self>) -> Retained<Self>;
493
494        #[unsafe(method(new))]
495        #[unsafe(method_family = new)]
496        pub fn new() -> Retained<Self>;
497    );
498}
499
500impl DefaultRetained for MTLStageInputOutputDescriptor {
501    #[inline]
502    fn default_retained() -> Retained<Self> {
503        Self::new()
504    }
505}