objc2_metal/generated/
MTLRenderPipeline.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/mtlblendfactor?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct MTLBlendFactor(pub NSUInteger);
15impl MTLBlendFactor {
16    #[doc(alias = "MTLBlendFactorZero")]
17    pub const Zero: Self = Self(0);
18    #[doc(alias = "MTLBlendFactorOne")]
19    pub const One: Self = Self(1);
20    #[doc(alias = "MTLBlendFactorSourceColor")]
21    pub const SourceColor: Self = Self(2);
22    #[doc(alias = "MTLBlendFactorOneMinusSourceColor")]
23    pub const OneMinusSourceColor: Self = Self(3);
24    #[doc(alias = "MTLBlendFactorSourceAlpha")]
25    pub const SourceAlpha: Self = Self(4);
26    #[doc(alias = "MTLBlendFactorOneMinusSourceAlpha")]
27    pub const OneMinusSourceAlpha: Self = Self(5);
28    #[doc(alias = "MTLBlendFactorDestinationColor")]
29    pub const DestinationColor: Self = Self(6);
30    #[doc(alias = "MTLBlendFactorOneMinusDestinationColor")]
31    pub const OneMinusDestinationColor: Self = Self(7);
32    #[doc(alias = "MTLBlendFactorDestinationAlpha")]
33    pub const DestinationAlpha: Self = Self(8);
34    #[doc(alias = "MTLBlendFactorOneMinusDestinationAlpha")]
35    pub const OneMinusDestinationAlpha: Self = Self(9);
36    #[doc(alias = "MTLBlendFactorSourceAlphaSaturated")]
37    pub const SourceAlphaSaturated: Self = Self(10);
38    #[doc(alias = "MTLBlendFactorBlendColor")]
39    pub const BlendColor: Self = Self(11);
40    #[doc(alias = "MTLBlendFactorOneMinusBlendColor")]
41    pub const OneMinusBlendColor: Self = Self(12);
42    #[doc(alias = "MTLBlendFactorBlendAlpha")]
43    pub const BlendAlpha: Self = Self(13);
44    #[doc(alias = "MTLBlendFactorOneMinusBlendAlpha")]
45    pub const OneMinusBlendAlpha: Self = Self(14);
46    #[doc(alias = "MTLBlendFactorSource1Color")]
47    pub const Source1Color: Self = Self(15);
48    #[doc(alias = "MTLBlendFactorOneMinusSource1Color")]
49    pub const OneMinusSource1Color: Self = Self(16);
50    #[doc(alias = "MTLBlendFactorSource1Alpha")]
51    pub const Source1Alpha: Self = Self(17);
52    #[doc(alias = "MTLBlendFactorOneMinusSource1Alpha")]
53    pub const OneMinusSource1Alpha: Self = Self(18);
54    /// Defers assigning the blend factor.
55    ///
56    /// Until you specialize this value in the pipeline state, it:
57    /// * behaves as `MTLBlendFactorOne` for `sourceRGBBlendFactor` and `sourceAlphaBlendFactor`
58    /// * behaves as `MTLBlendFactorZero` for `destinationRGBBlendFactor` and `destinationAlphaBlendFactor`
59    #[doc(alias = "MTLBlendFactorUnspecialized")]
60    pub const Unspecialized: Self = Self(19);
61}
62
63unsafe impl Encode for MTLBlendFactor {
64    const ENCODING: Encoding = NSUInteger::ENCODING;
65}
66
67unsafe impl RefEncode for MTLBlendFactor {
68    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
69}
70
71/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlblendoperation?language=objc)
72// NS_ENUM
73#[repr(transparent)]
74#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
75pub struct MTLBlendOperation(pub NSUInteger);
76impl MTLBlendOperation {
77    #[doc(alias = "MTLBlendOperationAdd")]
78    pub const Add: Self = Self(0);
79    #[doc(alias = "MTLBlendOperationSubtract")]
80    pub const Subtract: Self = Self(1);
81    #[doc(alias = "MTLBlendOperationReverseSubtract")]
82    pub const ReverseSubtract: Self = Self(2);
83    #[doc(alias = "MTLBlendOperationMin")]
84    pub const Min: Self = Self(3);
85    #[doc(alias = "MTLBlendOperationMax")]
86    pub const Max: Self = Self(4);
87    /// Defers assigning the blend operation.
88    #[doc(alias = "MTLBlendOperationUnspecialized")]
89    pub const Unspecialized: Self = Self(5);
90}
91
92unsafe impl Encode for MTLBlendOperation {
93    const ENCODING: Encoding = NSUInteger::ENCODING;
94}
95
96unsafe impl RefEncode for MTLBlendOperation {
97    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
98}
99
100/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlcolorwritemask?language=objc)
101// NS_OPTIONS
102#[repr(transparent)]
103#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
104pub struct MTLColorWriteMask(pub NSUInteger);
105bitflags::bitflags! {
106    impl MTLColorWriteMask: NSUInteger {
107        #[doc(alias = "MTLColorWriteMaskNone")]
108        const None = 0;
109        #[doc(alias = "MTLColorWriteMaskRed")]
110        const Red = 0x1<<3;
111        #[doc(alias = "MTLColorWriteMaskGreen")]
112        const Green = 0x1<<2;
113        #[doc(alias = "MTLColorWriteMaskBlue")]
114        const Blue = 0x1<<1;
115        #[doc(alias = "MTLColorWriteMaskAlpha")]
116        const Alpha = 0x1<<0;
117        #[doc(alias = "MTLColorWriteMaskAll")]
118        const All = 0xf;
119/// Defers assigning the color write mask.
120///
121/// Until you specialize this value in the pipeline state, it behaves as `MTLColorWriteMaskAll`.
122        #[doc(alias = "MTLColorWriteMaskUnspecialized")]
123        const Unspecialized = 0x10;
124    }
125}
126
127unsafe impl Encode for MTLColorWriteMask {
128    const ENCODING: Encoding = NSUInteger::ENCODING;
129}
130
131unsafe impl RefEncode for MTLColorWriteMask {
132    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
133}
134
135/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlprimitivetopologyclass?language=objc)
136// NS_ENUM
137#[repr(transparent)]
138#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
139pub struct MTLPrimitiveTopologyClass(pub NSUInteger);
140impl MTLPrimitiveTopologyClass {
141    #[doc(alias = "MTLPrimitiveTopologyClassUnspecified")]
142    pub const Unspecified: Self = Self(0);
143    #[doc(alias = "MTLPrimitiveTopologyClassPoint")]
144    pub const Point: Self = Self(1);
145    #[doc(alias = "MTLPrimitiveTopologyClassLine")]
146    pub const Line: Self = Self(2);
147    #[doc(alias = "MTLPrimitiveTopologyClassTriangle")]
148    pub const Triangle: Self = Self(3);
149}
150
151unsafe impl Encode for MTLPrimitiveTopologyClass {
152    const ENCODING: Encoding = NSUInteger::ENCODING;
153}
154
155unsafe impl RefEncode for MTLPrimitiveTopologyClass {
156    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
157}
158
159/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtltessellationpartitionmode?language=objc)
160// NS_ENUM
161#[repr(transparent)]
162#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
163pub struct MTLTessellationPartitionMode(pub NSUInteger);
164impl MTLTessellationPartitionMode {
165    #[doc(alias = "MTLTessellationPartitionModePow2")]
166    pub const Pow2: Self = Self(0);
167    #[doc(alias = "MTLTessellationPartitionModeInteger")]
168    pub const Integer: Self = Self(1);
169    #[doc(alias = "MTLTessellationPartitionModeFractionalOdd")]
170    pub const FractionalOdd: Self = Self(2);
171    #[doc(alias = "MTLTessellationPartitionModeFractionalEven")]
172    pub const FractionalEven: Self = Self(3);
173}
174
175unsafe impl Encode for MTLTessellationPartitionMode {
176    const ENCODING: Encoding = NSUInteger::ENCODING;
177}
178
179unsafe impl RefEncode for MTLTessellationPartitionMode {
180    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
181}
182
183/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtltessellationfactorstepfunction?language=objc)
184// NS_ENUM
185#[repr(transparent)]
186#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
187pub struct MTLTessellationFactorStepFunction(pub NSUInteger);
188impl MTLTessellationFactorStepFunction {
189    #[doc(alias = "MTLTessellationFactorStepFunctionConstant")]
190    pub const Constant: Self = Self(0);
191    #[doc(alias = "MTLTessellationFactorStepFunctionPerPatch")]
192    pub const PerPatch: Self = Self(1);
193    #[doc(alias = "MTLTessellationFactorStepFunctionPerInstance")]
194    pub const PerInstance: Self = Self(2);
195    #[doc(alias = "MTLTessellationFactorStepFunctionPerPatchAndPerInstance")]
196    pub const PerPatchAndPerInstance: Self = Self(3);
197}
198
199unsafe impl Encode for MTLTessellationFactorStepFunction {
200    const ENCODING: Encoding = NSUInteger::ENCODING;
201}
202
203unsafe impl RefEncode for MTLTessellationFactorStepFunction {
204    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
205}
206
207/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtltessellationfactorformat?language=objc)
208// NS_ENUM
209#[repr(transparent)]
210#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
211pub struct MTLTessellationFactorFormat(pub NSUInteger);
212impl MTLTessellationFactorFormat {
213    #[doc(alias = "MTLTessellationFactorFormatHalf")]
214    pub const Half: Self = Self(0);
215}
216
217unsafe impl Encode for MTLTessellationFactorFormat {
218    const ENCODING: Encoding = NSUInteger::ENCODING;
219}
220
221unsafe impl RefEncode for MTLTessellationFactorFormat {
222    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
223}
224
225/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtltessellationcontrolpointindextype?language=objc)
226// NS_ENUM
227#[repr(transparent)]
228#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
229pub struct MTLTessellationControlPointIndexType(pub NSUInteger);
230impl MTLTessellationControlPointIndexType {
231    #[doc(alias = "MTLTessellationControlPointIndexTypeNone")]
232    pub const None: Self = Self(0);
233    #[doc(alias = "MTLTessellationControlPointIndexTypeUInt16")]
234    pub const UInt16: Self = Self(1);
235    #[doc(alias = "MTLTessellationControlPointIndexTypeUInt32")]
236    pub const UInt32: Self = Self(2);
237}
238
239unsafe impl Encode for MTLTessellationControlPointIndexType {
240    const ENCODING: Encoding = NSUInteger::ENCODING;
241}
242
243unsafe impl RefEncode for MTLTessellationControlPointIndexType {
244    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
245}
246
247extern_class!(
248    /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlrenderpipelinecolorattachmentdescriptor?language=objc)
249    #[unsafe(super(NSObject))]
250    #[derive(Debug, PartialEq, Eq, Hash)]
251    pub struct MTLRenderPipelineColorAttachmentDescriptor;
252);
253
254extern_conformance!(
255    unsafe impl NSCopying for MTLRenderPipelineColorAttachmentDescriptor {}
256);
257
258unsafe impl CopyingHelper for MTLRenderPipelineColorAttachmentDescriptor {
259    type Result = Self;
260}
261
262extern_conformance!(
263    unsafe impl NSObjectProtocol for MTLRenderPipelineColorAttachmentDescriptor {}
264);
265
266impl MTLRenderPipelineColorAttachmentDescriptor {
267    extern_methods!(
268        #[cfg(feature = "MTLPixelFormat")]
269        /// Pixel format.  Defaults to MTLPixelFormatInvalid
270        #[unsafe(method(pixelFormat))]
271        #[unsafe(method_family = none)]
272        pub fn pixelFormat(&self) -> MTLPixelFormat;
273
274        #[cfg(feature = "MTLPixelFormat")]
275        /// Setter for [`pixelFormat`][Self::pixelFormat].
276        #[unsafe(method(setPixelFormat:))]
277        #[unsafe(method_family = none)]
278        pub fn setPixelFormat(&self, pixel_format: MTLPixelFormat);
279
280        /// Enable blending.  Defaults to NO.
281        #[unsafe(method(isBlendingEnabled))]
282        #[unsafe(method_family = none)]
283        pub fn isBlendingEnabled(&self) -> bool;
284
285        /// Setter for [`isBlendingEnabled`][Self::isBlendingEnabled].
286        #[unsafe(method(setBlendingEnabled:))]
287        #[unsafe(method_family = none)]
288        pub fn setBlendingEnabled(&self, blending_enabled: bool);
289
290        /// Defaults to MTLBlendFactorOne
291        #[unsafe(method(sourceRGBBlendFactor))]
292        #[unsafe(method_family = none)]
293        pub fn sourceRGBBlendFactor(&self) -> MTLBlendFactor;
294
295        /// Setter for [`sourceRGBBlendFactor`][Self::sourceRGBBlendFactor].
296        #[unsafe(method(setSourceRGBBlendFactor:))]
297        #[unsafe(method_family = none)]
298        pub fn setSourceRGBBlendFactor(&self, source_rgb_blend_factor: MTLBlendFactor);
299
300        /// Defaults to MTLBlendFactorZero
301        #[unsafe(method(destinationRGBBlendFactor))]
302        #[unsafe(method_family = none)]
303        pub fn destinationRGBBlendFactor(&self) -> MTLBlendFactor;
304
305        /// Setter for [`destinationRGBBlendFactor`][Self::destinationRGBBlendFactor].
306        #[unsafe(method(setDestinationRGBBlendFactor:))]
307        #[unsafe(method_family = none)]
308        pub fn setDestinationRGBBlendFactor(&self, destination_rgb_blend_factor: MTLBlendFactor);
309
310        /// Defaults to MTLBlendOperationAdd
311        #[unsafe(method(rgbBlendOperation))]
312        #[unsafe(method_family = none)]
313        pub fn rgbBlendOperation(&self) -> MTLBlendOperation;
314
315        /// Setter for [`rgbBlendOperation`][Self::rgbBlendOperation].
316        #[unsafe(method(setRgbBlendOperation:))]
317        #[unsafe(method_family = none)]
318        pub fn setRgbBlendOperation(&self, rgb_blend_operation: MTLBlendOperation);
319
320        /// Defaults to MTLBlendFactorOne
321        #[unsafe(method(sourceAlphaBlendFactor))]
322        #[unsafe(method_family = none)]
323        pub fn sourceAlphaBlendFactor(&self) -> MTLBlendFactor;
324
325        /// Setter for [`sourceAlphaBlendFactor`][Self::sourceAlphaBlendFactor].
326        #[unsafe(method(setSourceAlphaBlendFactor:))]
327        #[unsafe(method_family = none)]
328        pub fn setSourceAlphaBlendFactor(&self, source_alpha_blend_factor: MTLBlendFactor);
329
330        /// Defaults to MTLBlendFactorZero
331        #[unsafe(method(destinationAlphaBlendFactor))]
332        #[unsafe(method_family = none)]
333        pub fn destinationAlphaBlendFactor(&self) -> MTLBlendFactor;
334
335        /// Setter for [`destinationAlphaBlendFactor`][Self::destinationAlphaBlendFactor].
336        #[unsafe(method(setDestinationAlphaBlendFactor:))]
337        #[unsafe(method_family = none)]
338        pub fn setDestinationAlphaBlendFactor(
339            &self,
340            destination_alpha_blend_factor: MTLBlendFactor,
341        );
342
343        /// Defaults to MTLBlendOperationAdd
344        #[unsafe(method(alphaBlendOperation))]
345        #[unsafe(method_family = none)]
346        pub fn alphaBlendOperation(&self) -> MTLBlendOperation;
347
348        /// Setter for [`alphaBlendOperation`][Self::alphaBlendOperation].
349        #[unsafe(method(setAlphaBlendOperation:))]
350        #[unsafe(method_family = none)]
351        pub fn setAlphaBlendOperation(&self, alpha_blend_operation: MTLBlendOperation);
352
353        /// Defaults to MTLColorWriteMaskAll
354        #[unsafe(method(writeMask))]
355        #[unsafe(method_family = none)]
356        pub fn writeMask(&self) -> MTLColorWriteMask;
357
358        /// Setter for [`writeMask`][Self::writeMask].
359        #[unsafe(method(setWriteMask:))]
360        #[unsafe(method_family = none)]
361        pub fn setWriteMask(&self, write_mask: MTLColorWriteMask);
362    );
363}
364
365/// Methods declared on superclass `NSObject`.
366impl MTLRenderPipelineColorAttachmentDescriptor {
367    extern_methods!(
368        #[unsafe(method(init))]
369        #[unsafe(method_family = init)]
370        pub fn init(this: Allocated<Self>) -> Retained<Self>;
371
372        #[unsafe(method(new))]
373        #[unsafe(method_family = new)]
374        pub fn new() -> Retained<Self>;
375    );
376}
377
378impl DefaultRetained for MTLRenderPipelineColorAttachmentDescriptor {
379    #[inline]
380    fn default_retained() -> Retained<Self> {
381        Self::new()
382    }
383}
384
385extern_class!(
386    /// Allows you to easily specify color attachment remapping from logical to physical indices.
387    ///
388    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtllogicaltophysicalcolorattachmentmap?language=objc)
389    #[unsafe(super(NSObject))]
390    #[derive(Debug, PartialEq, Eq, Hash)]
391    pub struct MTLLogicalToPhysicalColorAttachmentMap;
392);
393
394extern_conformance!(
395    unsafe impl NSCopying for MTLLogicalToPhysicalColorAttachmentMap {}
396);
397
398unsafe impl CopyingHelper for MTLLogicalToPhysicalColorAttachmentMap {
399    type Result = Self;
400}
401
402extern_conformance!(
403    unsafe impl NSObjectProtocol for MTLLogicalToPhysicalColorAttachmentMap {}
404);
405
406impl MTLLogicalToPhysicalColorAttachmentMap {
407    extern_methods!(
408        /// Maps a physical color attachment index to a logical index.
409        ///
410        /// - Parameters:
411        /// - physicalIndex: index of the color attachment's physical mapping.
412        /// - logicalIndex: index of the color attachment's logical mapping.
413        ///
414        /// # Safety
415        ///
416        /// - `physicalIndex` might not be bounds-checked.
417        /// - `logicalIndex` might not be bounds-checked.
418        #[unsafe(method(setPhysicalIndex:forLogicalIndex:))]
419        #[unsafe(method_family = none)]
420        pub unsafe fn setPhysicalIndex_forLogicalIndex(
421            &self,
422            physical_index: NSUInteger,
423            logical_index: NSUInteger,
424        );
425
426        /// Queries the physical color attachment index corresponding to a logical index.
427        ///
428        /// # Safety
429        ///
430        /// `logicalIndex` might not be bounds-checked.
431        #[unsafe(method(getPhysicalIndexForLogicalIndex:))]
432        #[unsafe(method_family = none)]
433        pub unsafe fn getPhysicalIndexForLogicalIndex(
434            &self,
435            logical_index: NSUInteger,
436        ) -> NSUInteger;
437
438        #[unsafe(method(reset))]
439        #[unsafe(method_family = none)]
440        pub fn reset(&self);
441    );
442}
443
444/// Methods declared on superclass `NSObject`.
445impl MTLLogicalToPhysicalColorAttachmentMap {
446    extern_methods!(
447        #[unsafe(method(init))]
448        #[unsafe(method_family = init)]
449        pub fn init(this: Allocated<Self>) -> Retained<Self>;
450
451        #[unsafe(method(new))]
452        #[unsafe(method_family = new)]
453        pub fn new() -> Retained<Self>;
454    );
455}
456
457impl DefaultRetained for MTLLogicalToPhysicalColorAttachmentMap {
458    #[inline]
459    fn default_retained() -> Retained<Self> {
460        Self::new()
461    }
462}
463
464extern_class!(
465    /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlrenderpipelinereflection?language=objc)
466    #[unsafe(super(NSObject))]
467    #[derive(Debug, PartialEq, Eq, Hash)]
468    pub struct MTLRenderPipelineReflection;
469);
470
471unsafe impl Send for MTLRenderPipelineReflection {}
472
473unsafe impl Sync for MTLRenderPipelineReflection {}
474
475extern_conformance!(
476    unsafe impl NSObjectProtocol for MTLRenderPipelineReflection {}
477);
478
479impl MTLRenderPipelineReflection {
480    extern_methods!(
481        #[cfg(feature = "MTLArgument")]
482        #[unsafe(method(vertexBindings))]
483        #[unsafe(method_family = none)]
484        pub fn vertexBindings(&self) -> Retained<NSArray<ProtocolObject<dyn MTLBinding>>>;
485
486        #[cfg(feature = "MTLArgument")]
487        #[unsafe(method(fragmentBindings))]
488        #[unsafe(method_family = none)]
489        pub fn fragmentBindings(&self) -> Retained<NSArray<ProtocolObject<dyn MTLBinding>>>;
490
491        #[cfg(feature = "MTLArgument")]
492        #[unsafe(method(tileBindings))]
493        #[unsafe(method_family = none)]
494        pub fn tileBindings(&self) -> Retained<NSArray<ProtocolObject<dyn MTLBinding>>>;
495
496        #[cfg(feature = "MTLArgument")]
497        #[unsafe(method(objectBindings))]
498        #[unsafe(method_family = none)]
499        pub fn objectBindings(&self) -> Retained<NSArray<ProtocolObject<dyn MTLBinding>>>;
500
501        #[cfg(feature = "MTLArgument")]
502        #[unsafe(method(meshBindings))]
503        #[unsafe(method_family = none)]
504        pub fn meshBindings(&self) -> Retained<NSArray<ProtocolObject<dyn MTLBinding>>>;
505
506        #[cfg(feature = "MTLArgument")]
507        #[deprecated]
508        #[unsafe(method(vertexArguments))]
509        #[unsafe(method_family = none)]
510        pub fn vertexArguments(&self) -> Option<Retained<NSArray<MTLArgument>>>;
511
512        #[cfg(feature = "MTLArgument")]
513        #[deprecated]
514        #[unsafe(method(fragmentArguments))]
515        #[unsafe(method_family = none)]
516        pub fn fragmentArguments(&self) -> Option<Retained<NSArray<MTLArgument>>>;
517
518        #[cfg(feature = "MTLArgument")]
519        #[deprecated]
520        #[unsafe(method(tileArguments))]
521        #[unsafe(method_family = none)]
522        pub fn tileArguments(&self) -> Option<Retained<NSArray<MTLArgument>>>;
523    );
524}
525
526/// Methods declared on superclass `NSObject`.
527impl MTLRenderPipelineReflection {
528    extern_methods!(
529        #[unsafe(method(init))]
530        #[unsafe(method_family = init)]
531        pub fn init(this: Allocated<Self>) -> Retained<Self>;
532
533        #[unsafe(method(new))]
534        #[unsafe(method_family = new)]
535        pub fn new() -> Retained<Self>;
536    );
537}
538
539impl DefaultRetained for MTLRenderPipelineReflection {
540    #[inline]
541    fn default_retained() -> Retained<Self> {
542        Self::new()
543    }
544}
545
546extern_class!(
547    /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlrenderpipelinedescriptor?language=objc)
548    #[unsafe(super(NSObject))]
549    #[derive(Debug, PartialEq, Eq, Hash)]
550    pub struct MTLRenderPipelineDescriptor;
551);
552
553extern_conformance!(
554    unsafe impl NSCopying for MTLRenderPipelineDescriptor {}
555);
556
557unsafe impl CopyingHelper for MTLRenderPipelineDescriptor {
558    type Result = Self;
559}
560
561extern_conformance!(
562    unsafe impl NSObjectProtocol for MTLRenderPipelineDescriptor {}
563);
564
565impl MTLRenderPipelineDescriptor {
566    extern_methods!(
567        #[unsafe(method(label))]
568        #[unsafe(method_family = none)]
569        pub fn label(&self) -> Option<Retained<NSString>>;
570
571        /// Setter for [`label`][Self::label].
572        ///
573        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
574        #[unsafe(method(setLabel:))]
575        #[unsafe(method_family = none)]
576        pub fn setLabel(&self, label: Option<&NSString>);
577
578        #[cfg(feature = "MTLLibrary")]
579        #[unsafe(method(vertexFunction))]
580        #[unsafe(method_family = none)]
581        pub fn vertexFunction(&self) -> Option<Retained<ProtocolObject<dyn MTLFunction>>>;
582
583        #[cfg(feature = "MTLLibrary")]
584        /// Setter for [`vertexFunction`][Self::vertexFunction].
585        #[unsafe(method(setVertexFunction:))]
586        #[unsafe(method_family = none)]
587        pub fn setVertexFunction(&self, vertex_function: Option<&ProtocolObject<dyn MTLFunction>>);
588
589        #[cfg(feature = "MTLLibrary")]
590        #[unsafe(method(fragmentFunction))]
591        #[unsafe(method_family = none)]
592        pub fn fragmentFunction(&self) -> Option<Retained<ProtocolObject<dyn MTLFunction>>>;
593
594        #[cfg(feature = "MTLLibrary")]
595        /// Setter for [`fragmentFunction`][Self::fragmentFunction].
596        #[unsafe(method(setFragmentFunction:))]
597        #[unsafe(method_family = none)]
598        pub fn setFragmentFunction(
599            &self,
600            fragment_function: Option<&ProtocolObject<dyn MTLFunction>>,
601        );
602
603        #[cfg(feature = "MTLVertexDescriptor")]
604        #[unsafe(method(vertexDescriptor))]
605        #[unsafe(method_family = none)]
606        pub fn vertexDescriptor(&self) -> Option<Retained<MTLVertexDescriptor>>;
607
608        #[cfg(feature = "MTLVertexDescriptor")]
609        /// Setter for [`vertexDescriptor`][Self::vertexDescriptor].
610        ///
611        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
612        #[unsafe(method(setVertexDescriptor:))]
613        #[unsafe(method_family = none)]
614        pub fn setVertexDescriptor(&self, vertex_descriptor: Option<&MTLVertexDescriptor>);
615
616        #[deprecated]
617        #[unsafe(method(sampleCount))]
618        #[unsafe(method_family = none)]
619        pub fn sampleCount(&self) -> NSUInteger;
620
621        /// Setter for [`sampleCount`][Self::sampleCount].
622        #[deprecated]
623        #[unsafe(method(setSampleCount:))]
624        #[unsafe(method_family = none)]
625        pub fn setSampleCount(&self, sample_count: NSUInteger);
626
627        #[unsafe(method(rasterSampleCount))]
628        #[unsafe(method_family = none)]
629        pub fn rasterSampleCount(&self) -> NSUInteger;
630
631        /// Setter for [`rasterSampleCount`][Self::rasterSampleCount].
632        #[unsafe(method(setRasterSampleCount:))]
633        #[unsafe(method_family = none)]
634        pub fn setRasterSampleCount(&self, raster_sample_count: NSUInteger);
635
636        #[unsafe(method(isAlphaToCoverageEnabled))]
637        #[unsafe(method_family = none)]
638        pub fn isAlphaToCoverageEnabled(&self) -> bool;
639
640        /// Setter for [`isAlphaToCoverageEnabled`][Self::isAlphaToCoverageEnabled].
641        #[unsafe(method(setAlphaToCoverageEnabled:))]
642        #[unsafe(method_family = none)]
643        pub fn setAlphaToCoverageEnabled(&self, alpha_to_coverage_enabled: bool);
644
645        #[unsafe(method(isAlphaToOneEnabled))]
646        #[unsafe(method_family = none)]
647        pub fn isAlphaToOneEnabled(&self) -> bool;
648
649        /// Setter for [`isAlphaToOneEnabled`][Self::isAlphaToOneEnabled].
650        #[unsafe(method(setAlphaToOneEnabled:))]
651        #[unsafe(method_family = none)]
652        pub fn setAlphaToOneEnabled(&self, alpha_to_one_enabled: bool);
653
654        #[unsafe(method(isRasterizationEnabled))]
655        #[unsafe(method_family = none)]
656        pub fn isRasterizationEnabled(&self) -> bool;
657
658        /// Setter for [`isRasterizationEnabled`][Self::isRasterizationEnabled].
659        #[unsafe(method(setRasterizationEnabled:))]
660        #[unsafe(method_family = none)]
661        pub fn setRasterizationEnabled(&self, rasterization_enabled: bool);
662
663        #[unsafe(method(maxVertexAmplificationCount))]
664        #[unsafe(method_family = none)]
665        pub fn maxVertexAmplificationCount(&self) -> NSUInteger;
666
667        /// Setter for [`maxVertexAmplificationCount`][Self::maxVertexAmplificationCount].
668        ///
669        /// # Safety
670        ///
671        /// This might not be bounds-checked.
672        #[unsafe(method(setMaxVertexAmplificationCount:))]
673        #[unsafe(method_family = none)]
674        pub unsafe fn setMaxVertexAmplificationCount(
675            &self,
676            max_vertex_amplification_count: NSUInteger,
677        );
678
679        #[unsafe(method(colorAttachments))]
680        #[unsafe(method_family = none)]
681        pub fn colorAttachments(&self)
682            -> Retained<MTLRenderPipelineColorAttachmentDescriptorArray>;
683
684        #[cfg(feature = "MTLPixelFormat")]
685        #[unsafe(method(depthAttachmentPixelFormat))]
686        #[unsafe(method_family = none)]
687        pub fn depthAttachmentPixelFormat(&self) -> MTLPixelFormat;
688
689        #[cfg(feature = "MTLPixelFormat")]
690        /// Setter for [`depthAttachmentPixelFormat`][Self::depthAttachmentPixelFormat].
691        #[unsafe(method(setDepthAttachmentPixelFormat:))]
692        #[unsafe(method_family = none)]
693        pub fn setDepthAttachmentPixelFormat(&self, depth_attachment_pixel_format: MTLPixelFormat);
694
695        #[cfg(feature = "MTLPixelFormat")]
696        #[unsafe(method(stencilAttachmentPixelFormat))]
697        #[unsafe(method_family = none)]
698        pub fn stencilAttachmentPixelFormat(&self) -> MTLPixelFormat;
699
700        #[cfg(feature = "MTLPixelFormat")]
701        /// Setter for [`stencilAttachmentPixelFormat`][Self::stencilAttachmentPixelFormat].
702        #[unsafe(method(setStencilAttachmentPixelFormat:))]
703        #[unsafe(method_family = none)]
704        pub fn setStencilAttachmentPixelFormat(
705            &self,
706            stencil_attachment_pixel_format: MTLPixelFormat,
707        );
708
709        #[unsafe(method(inputPrimitiveTopology))]
710        #[unsafe(method_family = none)]
711        pub fn inputPrimitiveTopology(&self) -> MTLPrimitiveTopologyClass;
712
713        /// Setter for [`inputPrimitiveTopology`][Self::inputPrimitiveTopology].
714        #[unsafe(method(setInputPrimitiveTopology:))]
715        #[unsafe(method_family = none)]
716        pub unsafe fn setInputPrimitiveTopology(
717            &self,
718            input_primitive_topology: MTLPrimitiveTopologyClass,
719        );
720
721        #[unsafe(method(tessellationPartitionMode))]
722        #[unsafe(method_family = none)]
723        pub fn tessellationPartitionMode(&self) -> MTLTessellationPartitionMode;
724
725        /// Setter for [`tessellationPartitionMode`][Self::tessellationPartitionMode].
726        #[unsafe(method(setTessellationPartitionMode:))]
727        #[unsafe(method_family = none)]
728        pub unsafe fn setTessellationPartitionMode(
729            &self,
730            tessellation_partition_mode: MTLTessellationPartitionMode,
731        );
732
733        #[unsafe(method(maxTessellationFactor))]
734        #[unsafe(method_family = none)]
735        pub fn maxTessellationFactor(&self) -> NSUInteger;
736
737        /// Setter for [`maxTessellationFactor`][Self::maxTessellationFactor].
738        #[unsafe(method(setMaxTessellationFactor:))]
739        #[unsafe(method_family = none)]
740        pub unsafe fn setMaxTessellationFactor(&self, max_tessellation_factor: NSUInteger);
741
742        #[unsafe(method(isTessellationFactorScaleEnabled))]
743        #[unsafe(method_family = none)]
744        pub fn isTessellationFactorScaleEnabled(&self) -> bool;
745
746        /// Setter for [`isTessellationFactorScaleEnabled`][Self::isTessellationFactorScaleEnabled].
747        #[unsafe(method(setTessellationFactorScaleEnabled:))]
748        #[unsafe(method_family = none)]
749        pub fn setTessellationFactorScaleEnabled(&self, tessellation_factor_scale_enabled: bool);
750
751        #[unsafe(method(tessellationFactorFormat))]
752        #[unsafe(method_family = none)]
753        pub fn tessellationFactorFormat(&self) -> MTLTessellationFactorFormat;
754
755        /// Setter for [`tessellationFactorFormat`][Self::tessellationFactorFormat].
756        #[unsafe(method(setTessellationFactorFormat:))]
757        #[unsafe(method_family = none)]
758        pub fn setTessellationFactorFormat(
759            &self,
760            tessellation_factor_format: MTLTessellationFactorFormat,
761        );
762
763        #[unsafe(method(tessellationControlPointIndexType))]
764        #[unsafe(method_family = none)]
765        pub fn tessellationControlPointIndexType(&self) -> MTLTessellationControlPointIndexType;
766
767        /// Setter for [`tessellationControlPointIndexType`][Self::tessellationControlPointIndexType].
768        #[unsafe(method(setTessellationControlPointIndexType:))]
769        #[unsafe(method_family = none)]
770        pub unsafe fn setTessellationControlPointIndexType(
771            &self,
772            tessellation_control_point_index_type: MTLTessellationControlPointIndexType,
773        );
774
775        #[unsafe(method(tessellationFactorStepFunction))]
776        #[unsafe(method_family = none)]
777        pub fn tessellationFactorStepFunction(&self) -> MTLTessellationFactorStepFunction;
778
779        /// Setter for [`tessellationFactorStepFunction`][Self::tessellationFactorStepFunction].
780        #[unsafe(method(setTessellationFactorStepFunction:))]
781        #[unsafe(method_family = none)]
782        pub fn setTessellationFactorStepFunction(
783            &self,
784            tessellation_factor_step_function: MTLTessellationFactorStepFunction,
785        );
786
787        #[cfg(feature = "MTLRenderCommandEncoder")]
788        #[unsafe(method(tessellationOutputWindingOrder))]
789        #[unsafe(method_family = none)]
790        pub fn tessellationOutputWindingOrder(&self) -> MTLWinding;
791
792        #[cfg(feature = "MTLRenderCommandEncoder")]
793        /// Setter for [`tessellationOutputWindingOrder`][Self::tessellationOutputWindingOrder].
794        #[unsafe(method(setTessellationOutputWindingOrder:))]
795        #[unsafe(method_family = none)]
796        pub fn setTessellationOutputWindingOrder(
797            &self,
798            tessellation_output_winding_order: MTLWinding,
799        );
800
801        #[cfg(feature = "MTLPipeline")]
802        #[unsafe(method(vertexBuffers))]
803        #[unsafe(method_family = none)]
804        pub fn vertexBuffers(&self) -> Retained<MTLPipelineBufferDescriptorArray>;
805
806        #[cfg(feature = "MTLPipeline")]
807        #[unsafe(method(fragmentBuffers))]
808        #[unsafe(method_family = none)]
809        pub fn fragmentBuffers(&self) -> Retained<MTLPipelineBufferDescriptorArray>;
810
811        #[unsafe(method(supportIndirectCommandBuffers))]
812        #[unsafe(method_family = none)]
813        pub fn supportIndirectCommandBuffers(&self) -> bool;
814
815        /// Setter for [`supportIndirectCommandBuffers`][Self::supportIndirectCommandBuffers].
816        #[unsafe(method(setSupportIndirectCommandBuffers:))]
817        #[unsafe(method_family = none)]
818        pub fn setSupportIndirectCommandBuffers(&self, support_indirect_command_buffers: bool);
819
820        #[cfg(feature = "MTLBinaryArchive")]
821        /// The set of MTLBinaryArchive to search for compiled code when creating the pipeline state.
822        ///
823        /// Accelerate pipeline state creation by providing archives of compiled code such that no compilation needs to happen on the fast path.
824        ///
825        /// See: MTLBinaryArchive
826        #[unsafe(method(binaryArchives))]
827        #[unsafe(method_family = none)]
828        pub fn binaryArchives(
829            &self,
830        ) -> Option<Retained<NSArray<ProtocolObject<dyn MTLBinaryArchive>>>>;
831
832        #[cfg(feature = "MTLBinaryArchive")]
833        /// Setter for [`binaryArchives`][Self::binaryArchives].
834        ///
835        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
836        #[unsafe(method(setBinaryArchives:))]
837        #[unsafe(method_family = none)]
838        pub fn setBinaryArchives(
839            &self,
840            binary_archives: Option<&NSArray<ProtocolObject<dyn MTLBinaryArchive>>>,
841        );
842
843        #[cfg(feature = "MTLDynamicLibrary")]
844        /// The set of MTLDynamicLibrary to use to resolve external symbols for the vertexFunction before considering symbols from dependent MTLDynamicLibrary.
845        ///
846        /// Typical workflows use the libraries property of MTLCompileOptions to record dependent libraries at compile time without having to use vertexPreloadedLibraries.
847        /// This property can be used to override symbols from dependent libraries for experimentation or evaluating alternative implementations.
848        /// It can also be used to provide dynamic libraries that are dynamically created (for example, from source) that have no stable installName that can be used to automatically load from the file system.
849        ///
850        /// See: MTLDynamicLibrary
851        #[unsafe(method(vertexPreloadedLibraries))]
852        #[unsafe(method_family = none)]
853        pub fn vertexPreloadedLibraries(
854            &self,
855        ) -> Retained<NSArray<ProtocolObject<dyn MTLDynamicLibrary>>>;
856
857        #[cfg(feature = "MTLDynamicLibrary")]
858        /// Setter for [`vertexPreloadedLibraries`][Self::vertexPreloadedLibraries].
859        ///
860        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
861        #[unsafe(method(setVertexPreloadedLibraries:))]
862        #[unsafe(method_family = none)]
863        pub fn setVertexPreloadedLibraries(
864            &self,
865            vertex_preloaded_libraries: &NSArray<ProtocolObject<dyn MTLDynamicLibrary>>,
866        );
867
868        #[cfg(feature = "MTLDynamicLibrary")]
869        /// The set of MTLDynamicLibrary to use to resolve external symbols for the fragmentFunction before considering symbols from dependent MTLDynamicLibrary.
870        ///
871        /// Typical workflows use the libraries property of MTLCompileOptions to record dependent libraries at compile time without having to use fragmentPreloadedLibraries.
872        /// This property can be used to override symbols from dependent libraries for experimentation or evaluating alternative implementations.
873        /// It can also be used to provide dynamic libraries that are dynamically created (for example, from source) that have no stable installName that can be used to automatically load from the file system.
874        ///
875        /// See: MTLDynamicLibrary
876        #[unsafe(method(fragmentPreloadedLibraries))]
877        #[unsafe(method_family = none)]
878        pub fn fragmentPreloadedLibraries(
879            &self,
880        ) -> Retained<NSArray<ProtocolObject<dyn MTLDynamicLibrary>>>;
881
882        #[cfg(feature = "MTLDynamicLibrary")]
883        /// Setter for [`fragmentPreloadedLibraries`][Self::fragmentPreloadedLibraries].
884        ///
885        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
886        #[unsafe(method(setFragmentPreloadedLibraries:))]
887        #[unsafe(method_family = none)]
888        pub fn setFragmentPreloadedLibraries(
889            &self,
890            fragment_preloaded_libraries: &NSArray<ProtocolObject<dyn MTLDynamicLibrary>>,
891        );
892
893        #[cfg(feature = "MTLLinkedFunctions")]
894        /// The set of functions to be linked with the pipeline state and accessed from the vertex function.
895        ///
896        /// See: MTLLinkedFunctions
897        #[unsafe(method(vertexLinkedFunctions))]
898        #[unsafe(method_family = none)]
899        pub fn vertexLinkedFunctions(&self) -> Retained<MTLLinkedFunctions>;
900
901        #[cfg(feature = "MTLLinkedFunctions")]
902        /// Setter for [`vertexLinkedFunctions`][Self::vertexLinkedFunctions].
903        ///
904        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
905        #[unsafe(method(setVertexLinkedFunctions:))]
906        #[unsafe(method_family = none)]
907        pub fn setVertexLinkedFunctions(
908            &self,
909            vertex_linked_functions: Option<&MTLLinkedFunctions>,
910        );
911
912        #[cfg(feature = "MTLLinkedFunctions")]
913        /// The set of functions to be linked with the pipeline state and accessed from the fragment function.
914        ///
915        /// See: MTLLinkedFunctions
916        #[unsafe(method(fragmentLinkedFunctions))]
917        #[unsafe(method_family = none)]
918        pub fn fragmentLinkedFunctions(&self) -> Retained<MTLLinkedFunctions>;
919
920        #[cfg(feature = "MTLLinkedFunctions")]
921        /// Setter for [`fragmentLinkedFunctions`][Self::fragmentLinkedFunctions].
922        ///
923        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
924        #[unsafe(method(setFragmentLinkedFunctions:))]
925        #[unsafe(method_family = none)]
926        pub fn setFragmentLinkedFunctions(
927            &self,
928            fragment_linked_functions: Option<&MTLLinkedFunctions>,
929        );
930
931        /// This flag makes this pipeline support creating a new pipeline by adding binary functions.
932        #[unsafe(method(supportAddingVertexBinaryFunctions))]
933        #[unsafe(method_family = none)]
934        pub fn supportAddingVertexBinaryFunctions(&self) -> bool;
935
936        /// Setter for [`supportAddingVertexBinaryFunctions`][Self::supportAddingVertexBinaryFunctions].
937        #[unsafe(method(setSupportAddingVertexBinaryFunctions:))]
938        #[unsafe(method_family = none)]
939        pub fn setSupportAddingVertexBinaryFunctions(
940            &self,
941            support_adding_vertex_binary_functions: bool,
942        );
943
944        /// This flag makes this pipeline support creating a new pipeline by adding binary functions.
945        #[unsafe(method(supportAddingFragmentBinaryFunctions))]
946        #[unsafe(method_family = none)]
947        pub fn supportAddingFragmentBinaryFunctions(&self) -> bool;
948
949        /// Setter for [`supportAddingFragmentBinaryFunctions`][Self::supportAddingFragmentBinaryFunctions].
950        #[unsafe(method(setSupportAddingFragmentBinaryFunctions:))]
951        #[unsafe(method_family = none)]
952        pub fn setSupportAddingFragmentBinaryFunctions(
953            &self,
954            support_adding_fragment_binary_functions: bool,
955        );
956
957        /// The maximum depth of the call stack in stack frames from the shader. Defaults to 1 additional stack frame.
958        #[unsafe(method(maxVertexCallStackDepth))]
959        #[unsafe(method_family = none)]
960        pub fn maxVertexCallStackDepth(&self) -> NSUInteger;
961
962        /// Setter for [`maxVertexCallStackDepth`][Self::maxVertexCallStackDepth].
963        #[unsafe(method(setMaxVertexCallStackDepth:))]
964        #[unsafe(method_family = none)]
965        pub fn setMaxVertexCallStackDepth(&self, max_vertex_call_stack_depth: NSUInteger);
966
967        /// The maximum depth of the call stack in stack frames from the shader. Defaults to 1 additional stack frame.
968        #[unsafe(method(maxFragmentCallStackDepth))]
969        #[unsafe(method_family = none)]
970        pub fn maxFragmentCallStackDepth(&self) -> NSUInteger;
971
972        /// Setter for [`maxFragmentCallStackDepth`][Self::maxFragmentCallStackDepth].
973        #[unsafe(method(setMaxFragmentCallStackDepth:))]
974        #[unsafe(method_family = none)]
975        pub fn setMaxFragmentCallStackDepth(&self, max_fragment_call_stack_depth: NSUInteger);
976
977        /// Restore all pipeline descriptor properties to their default values.
978        #[unsafe(method(reset))]
979        #[unsafe(method_family = none)]
980        pub fn reset(&self);
981
982        #[cfg(feature = "MTLPipeline")]
983        /// Toggle that determines whether Metal Shader Validation should be enabled or disabled for the pipeline.
984        ///
985        /// The value can be overridden using `MTL_SHADER_VALIDATION_ENABLE_PIPELINES` or `MTL_SHADER_VALIDATION_DISABLE_PIPELINES` Environment Variables.
986        #[unsafe(method(shaderValidation))]
987        #[unsafe(method_family = none)]
988        pub fn shaderValidation(&self) -> MTLShaderValidation;
989
990        #[cfg(feature = "MTLPipeline")]
991        /// Setter for [`shaderValidation`][Self::shaderValidation].
992        #[unsafe(method(setShaderValidation:))]
993        #[unsafe(method_family = none)]
994        pub fn setShaderValidation(&self, shader_validation: MTLShaderValidation);
995    );
996}
997
998/// Methods declared on superclass `NSObject`.
999impl MTLRenderPipelineDescriptor {
1000    extern_methods!(
1001        #[unsafe(method(init))]
1002        #[unsafe(method_family = init)]
1003        pub fn init(this: Allocated<Self>) -> Retained<Self>;
1004
1005        #[unsafe(method(new))]
1006        #[unsafe(method_family = new)]
1007        pub fn new() -> Retained<Self>;
1008    );
1009}
1010
1011impl DefaultRetained for MTLRenderPipelineDescriptor {
1012    #[inline]
1013    fn default_retained() -> Retained<Self> {
1014        Self::new()
1015    }
1016}
1017
1018extern_class!(
1019    /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlrenderpipelinefunctionsdescriptor?language=objc)
1020    #[unsafe(super(NSObject))]
1021    #[derive(Debug, PartialEq, Eq, Hash)]
1022    pub struct MTLRenderPipelineFunctionsDescriptor;
1023);
1024
1025extern_conformance!(
1026    unsafe impl NSCopying for MTLRenderPipelineFunctionsDescriptor {}
1027);
1028
1029unsafe impl CopyingHelper for MTLRenderPipelineFunctionsDescriptor {
1030    type Result = Self;
1031}
1032
1033extern_conformance!(
1034    unsafe impl NSObjectProtocol for MTLRenderPipelineFunctionsDescriptor {}
1035);
1036
1037impl MTLRenderPipelineFunctionsDescriptor {
1038    extern_methods!(
1039        #[cfg(feature = "MTLLibrary")]
1040        /// The set of additional binary functions to be accessed from the vertex function in an incrementally created pipeline state.
1041        #[unsafe(method(vertexAdditionalBinaryFunctions))]
1042        #[unsafe(method_family = none)]
1043        pub fn vertexAdditionalBinaryFunctions(
1044            &self,
1045        ) -> Option<Retained<NSArray<ProtocolObject<dyn MTLFunction>>>>;
1046
1047        #[cfg(feature = "MTLLibrary")]
1048        /// Setter for [`vertexAdditionalBinaryFunctions`][Self::vertexAdditionalBinaryFunctions].
1049        ///
1050        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
1051        ///
1052        /// # Safety
1053        ///
1054        /// - `vertex_additional_binary_functions` generic must be safe to call.
1055        /// - `vertex_additional_binary_functions` generic must have the correct argument and return types.
1056        #[unsafe(method(setVertexAdditionalBinaryFunctions:))]
1057        #[unsafe(method_family = none)]
1058        pub unsafe fn setVertexAdditionalBinaryFunctions(
1059            &self,
1060            vertex_additional_binary_functions: Option<&NSArray<ProtocolObject<dyn MTLFunction>>>,
1061        );
1062
1063        #[cfg(feature = "MTLLibrary")]
1064        /// The set of additional binary functions to be accessed from the fragment function in an incrementally created pipeline state.
1065        #[unsafe(method(fragmentAdditionalBinaryFunctions))]
1066        #[unsafe(method_family = none)]
1067        pub fn fragmentAdditionalBinaryFunctions(
1068            &self,
1069        ) -> Option<Retained<NSArray<ProtocolObject<dyn MTLFunction>>>>;
1070
1071        #[cfg(feature = "MTLLibrary")]
1072        /// Setter for [`fragmentAdditionalBinaryFunctions`][Self::fragmentAdditionalBinaryFunctions].
1073        ///
1074        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
1075        ///
1076        /// # Safety
1077        ///
1078        /// - `fragment_additional_binary_functions` generic must be safe to call.
1079        /// - `fragment_additional_binary_functions` generic must have the correct argument and return types.
1080        #[unsafe(method(setFragmentAdditionalBinaryFunctions:))]
1081        #[unsafe(method_family = none)]
1082        pub unsafe fn setFragmentAdditionalBinaryFunctions(
1083            &self,
1084            fragment_additional_binary_functions: Option<&NSArray<ProtocolObject<dyn MTLFunction>>>,
1085        );
1086
1087        #[cfg(feature = "MTLLibrary")]
1088        /// The set of additional binary functions to be accessed from the tile function in an incrementally created pipeline state.
1089        #[unsafe(method(tileAdditionalBinaryFunctions))]
1090        #[unsafe(method_family = none)]
1091        pub fn tileAdditionalBinaryFunctions(
1092            &self,
1093        ) -> Option<Retained<NSArray<ProtocolObject<dyn MTLFunction>>>>;
1094
1095        #[cfg(feature = "MTLLibrary")]
1096        /// Setter for [`tileAdditionalBinaryFunctions`][Self::tileAdditionalBinaryFunctions].
1097        ///
1098        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
1099        ///
1100        /// # Safety
1101        ///
1102        /// - `tile_additional_binary_functions` generic must be safe to call.
1103        /// - `tile_additional_binary_functions` generic must have the correct argument and return types.
1104        #[unsafe(method(setTileAdditionalBinaryFunctions:))]
1105        #[unsafe(method_family = none)]
1106        pub unsafe fn setTileAdditionalBinaryFunctions(
1107            &self,
1108            tile_additional_binary_functions: Option<&NSArray<ProtocolObject<dyn MTLFunction>>>,
1109        );
1110    );
1111}
1112
1113/// Methods declared on superclass `NSObject`.
1114impl MTLRenderPipelineFunctionsDescriptor {
1115    extern_methods!(
1116        #[unsafe(method(init))]
1117        #[unsafe(method_family = init)]
1118        pub fn init(this: Allocated<Self>) -> Retained<Self>;
1119
1120        #[unsafe(method(new))]
1121        #[unsafe(method_family = new)]
1122        pub fn new() -> Retained<Self>;
1123    );
1124}
1125
1126impl DefaultRetained for MTLRenderPipelineFunctionsDescriptor {
1127    #[inline]
1128    fn default_retained() -> Retained<Self> {
1129        Self::new()
1130    }
1131}
1132
1133extern_protocol!(
1134    /// MTLRenderPipelineState represents a compiled render pipeline
1135    ///
1136    ///
1137    /// MTLRenderPipelineState is a compiled render pipeline and can be set on a MTLRenderCommandEncoder.
1138    ///
1139    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlrenderpipelinestate?language=objc)
1140    #[cfg(feature = "MTLAllocation")]
1141    pub unsafe trait MTLRenderPipelineState:
1142        MTLAllocation + NSObjectProtocol + Send + Sync
1143    {
1144        #[unsafe(method(label))]
1145        #[unsafe(method_family = none)]
1146        fn label(&self) -> Option<Retained<NSString>>;
1147
1148        #[cfg(feature = "MTLDevice")]
1149        #[unsafe(method(device))]
1150        #[unsafe(method_family = none)]
1151        fn device(&self) -> Retained<ProtocolObject<dyn MTLDevice>>;
1152
1153        /// Obtains a reflection object for this render pipeline.
1154        ///
1155        /// When you create the pipeline through an ``MTLDevice`` instance, reflection is `nil`.
1156        #[unsafe(method(reflection))]
1157        #[unsafe(method_family = none)]
1158        fn reflection(&self) -> Option<Retained<MTLRenderPipelineReflection>>;
1159
1160        #[cfg(all(feature = "MTLFunctionHandle", feature = "MTLRenderCommandEncoder"))]
1161        /// Obtains a function handle for the a specific function this pipeline links at the Metal IR level.
1162        ///
1163        /// - Parameters:
1164        /// - name: A string containing the name of the function.
1165        /// - stage: The shader stage that uses the function.
1166        ///
1167        /// - Returns: a function handle representing the function if present, otherwise `nil`.
1168        #[unsafe(method(functionHandleWithName:stage:))]
1169        #[unsafe(method_family = none)]
1170        fn functionHandleWithName_stage(
1171            &self,
1172            name: &NSString,
1173            stage: MTLRenderStages,
1174        ) -> Option<Retained<ProtocolObject<dyn MTLFunctionHandle>>>;
1175
1176        #[cfg(all(
1177            feature = "MTL4BinaryFunction",
1178            feature = "MTLFunctionHandle",
1179            feature = "MTLRenderCommandEncoder"
1180        ))]
1181        /// Obtains the function handle for a specific function this pipeline state links at the binary level.
1182        ///
1183        /// - Parameters:
1184        /// - function: a binary function to retrieve the handle.
1185        /// - stage: The shader stage that uses the function.
1186        ///
1187        /// - Returns: a function handle representing the function if present, otherwise `nil`.
1188        #[unsafe(method(functionHandleWithBinaryFunction:stage:))]
1189        #[unsafe(method_family = none)]
1190        fn functionHandleWithBinaryFunction_stage(
1191            &self,
1192            function: &ProtocolObject<dyn MTL4BinaryFunction>,
1193            stage: MTLRenderStages,
1194        ) -> Option<Retained<ProtocolObject<dyn MTLFunctionHandle>>>;
1195
1196        #[cfg(feature = "MTL4RenderPipeline")]
1197        /// Creates a new render pipeline state by adding binary functions to each stage of this pipeline
1198        /// state.
1199        ///
1200        /// - Parameters:
1201        /// - binaryFunctionsDescriptor: A non-`nil` dynamic linking descriptor.
1202        /// - error: An optional pointer that Metal populates with information in case of an error.
1203        ///
1204        /// - Returns: A new render pipeline state upon success, otherwise `nil`.
1205        #[unsafe(method(newRenderPipelineStateWithBinaryFunctions:error:_))]
1206        #[unsafe(method_family = new)]
1207        fn newRenderPipelineStateWithBinaryFunctions_error(
1208            &self,
1209            binary_functions_descriptor: &MTL4RenderPipelineBinaryFunctionsDescriptor,
1210        ) -> Result<Retained<ProtocolObject<dyn MTLRenderPipelineState>>, Retained<NSError>>;
1211
1212        #[cfg(feature = "MTL4PipelineState")]
1213        /// Creates a render pipeline descriptor from this pipeline that you can use for pipeline specialization.
1214        ///
1215        /// Use this method to obtain a new ``MTL4PipelineDescriptor`` instance that you can use to specialize any unspecialized
1216        /// properties in this pipeline state object.
1217        ///
1218        /// The returned descriptor contains every unspecialized field in the current pipeline state object, set to unspecialized.
1219        /// It may, however, not contain valid or accurate properties in any other field.
1220        ///
1221        /// This descriptor is only valid for the purpose of calling specialization functions on the ``MTL4Compiler`` to
1222        /// specialize this pipeline, for example: ``MTL4Compiler/newRenderPipelineStateBySpecializationWithDescriptor:pipeline:error:``.
1223        ///
1224        /// Although this method returns the ``MTL4PipelineDescriptor`` base class, the concrete instance this method returns
1225        /// corresponds to the specific descriptor type for the creation of this pipeline state, for example if a ``MTL4Compiler``
1226        /// instance creates this current pipeline form a ``MTLTileRenderPipelineDescriptor``, this method returns a concrete
1227        /// ``MTLTileRenderPipelineDescriptor`` instance.
1228        ///
1229        /// - Returns: a new pipeline descriptor that you use for pipeline state specialization.
1230        #[unsafe(method(newRenderPipelineDescriptorForSpecialization))]
1231        #[unsafe(method_family = new)]
1232        fn newRenderPipelineDescriptorForSpecialization(&self) -> Retained<MTL4PipelineDescriptor>;
1233
1234        /// The maximum total number of threads that can be in a single tile shader threadgroup.
1235        #[unsafe(method(maxTotalThreadsPerThreadgroup))]
1236        #[unsafe(method_family = none)]
1237        fn maxTotalThreadsPerThreadgroup(&self) -> NSUInteger;
1238
1239        /// Returns true when the pipeline state requires a tile shader threadgroup size equal to the tile size
1240        #[unsafe(method(threadgroupSizeMatchesTileSize))]
1241        #[unsafe(method_family = none)]
1242        fn threadgroupSizeMatchesTileSize(&self) -> bool;
1243
1244        /// Returns imageblock memory length used by a single sample when rendered using this pipeline.
1245        #[unsafe(method(imageblockSampleLength))]
1246        #[unsafe(method_family = none)]
1247        fn imageblockSampleLength(&self) -> NSUInteger;
1248
1249        #[cfg(feature = "MTLTypes")]
1250        /// Returns imageblock memory length for given image block dimensions. Dimensions must be valid tile dimensions.
1251        #[unsafe(method(imageblockMemoryLengthForDimensions:))]
1252        #[unsafe(method_family = none)]
1253        fn imageblockMemoryLengthForDimensions(&self, imageblock_dimensions: MTLSize)
1254            -> NSUInteger;
1255
1256        #[unsafe(method(supportIndirectCommandBuffers))]
1257        #[unsafe(method_family = none)]
1258        fn supportIndirectCommandBuffers(&self) -> bool;
1259
1260        /// The maximum total number of threads that can be in a single object shader threadgroup.
1261        ///
1262        /// This value is set in MTLMeshRenderPipelineDescriptor.
1263        #[unsafe(method(maxTotalThreadsPerObjectThreadgroup))]
1264        #[unsafe(method_family = none)]
1265        fn maxTotalThreadsPerObjectThreadgroup(&self) -> NSUInteger;
1266
1267        /// The maximum total number of threads that can be in a single mesh shader threadgroup.
1268        ///
1269        /// This value is set in MTLMeshRenderPipelineDescriptor.
1270        #[unsafe(method(maxTotalThreadsPerMeshThreadgroup))]
1271        #[unsafe(method_family = none)]
1272        fn maxTotalThreadsPerMeshThreadgroup(&self) -> NSUInteger;
1273
1274        /// The number of threads in a SIMD group of the object shader.
1275        ///
1276        /// This value is also available in the shader with the [[threads_per_simdgroup]] attribute.
1277        #[unsafe(method(objectThreadExecutionWidth))]
1278        #[unsafe(method_family = none)]
1279        fn objectThreadExecutionWidth(&self) -> NSUInteger;
1280
1281        /// The number of threads in a SIMD group of the mesh shader.
1282        ///
1283        /// This value is also available in the shader with the [[threads_per_simdgroup]] attribute.
1284        #[unsafe(method(meshThreadExecutionWidth))]
1285        #[unsafe(method_family = none)]
1286        fn meshThreadExecutionWidth(&self) -> NSUInteger;
1287
1288        /// The maximum total number of threadgroups that can be in a single mesh shader grid.
1289        ///
1290        /// This value is set in MTLMeshRenderPipelineDescriptor.
1291        #[unsafe(method(maxTotalThreadgroupsPerMeshGrid))]
1292        #[unsafe(method_family = none)]
1293        fn maxTotalThreadgroupsPerMeshGrid(&self) -> NSUInteger;
1294
1295        #[cfg(feature = "MTLTypes")]
1296        /// Handle of the GPU resource suitable for storing in an Argument Buffer
1297        #[unsafe(method(gpuResourceID))]
1298        #[unsafe(method_family = none)]
1299        fn gpuResourceID(&self) -> MTLResourceID;
1300
1301        #[cfg(all(
1302            feature = "MTLFunctionHandle",
1303            feature = "MTLLibrary",
1304            feature = "MTLRenderCommandEncoder"
1305        ))]
1306        /// Gets the function handle for the specified function on the specified stage of the pipeline.
1307        ///
1308        /// # Safety
1309        ///
1310        /// - `function` must be safe to call.
1311        /// - `function` must have the correct argument and return types.
1312        #[unsafe(method(functionHandleWithFunction:stage:))]
1313        #[unsafe(method_family = none)]
1314        unsafe fn functionHandleWithFunction_stage(
1315            &self,
1316            function: &ProtocolObject<dyn MTLFunction>,
1317            stage: MTLRenderStages,
1318        ) -> Option<Retained<ProtocolObject<dyn MTLFunctionHandle>>>;
1319
1320        #[cfg(all(
1321            feature = "MTLRenderCommandEncoder",
1322            feature = "MTLResource",
1323            feature = "MTLVisibleFunctionTable"
1324        ))]
1325        /// Allocate a visible function table for the specified stage of the pipeline with the provided descriptor.
1326        #[unsafe(method(newVisibleFunctionTableWithDescriptor:stage:))]
1327        #[unsafe(method_family = new)]
1328        fn newVisibleFunctionTableWithDescriptor_stage(
1329            &self,
1330            descriptor: &MTLVisibleFunctionTableDescriptor,
1331            stage: MTLRenderStages,
1332        ) -> Option<Retained<ProtocolObject<dyn MTLVisibleFunctionTable>>>;
1333
1334        #[cfg(all(
1335            feature = "MTLIntersectionFunctionTable",
1336            feature = "MTLRenderCommandEncoder",
1337            feature = "MTLResource"
1338        ))]
1339        /// Allocate an intersection function table for the specified stage of the pipeline with the provided descriptor.
1340        #[unsafe(method(newIntersectionFunctionTableWithDescriptor:stage:))]
1341        #[unsafe(method_family = new)]
1342        fn newIntersectionFunctionTableWithDescriptor_stage(
1343            &self,
1344            descriptor: &MTLIntersectionFunctionTableDescriptor,
1345            stage: MTLRenderStages,
1346        ) -> Option<Retained<ProtocolObject<dyn MTLIntersectionFunctionTable>>>;
1347
1348        /// Allocate a new render pipeline state by adding binary functions for each stage of this pipeline state.
1349        #[unsafe(method(newRenderPipelineStateWithAdditionalBinaryFunctions:error:_))]
1350        #[unsafe(method_family = new)]
1351        fn newRenderPipelineStateWithAdditionalBinaryFunctions_error(
1352            &self,
1353            additional_binary_functions: &MTLRenderPipelineFunctionsDescriptor,
1354        ) -> Result<Retained<ProtocolObject<dyn MTLRenderPipelineState>>, Retained<NSError>>;
1355
1356        #[cfg(feature = "MTLPipeline")]
1357        /// Current state of Shader Validation for the pipeline.
1358        ///
1359        /// This property is not atomic.
1360        ///
1361        /// # Safety
1362        ///
1363        /// This might not be thread-safe.
1364        #[unsafe(method(shaderValidation))]
1365        #[unsafe(method_family = none)]
1366        unsafe fn shaderValidation(&self) -> MTLShaderValidation;
1367
1368        #[cfg(feature = "MTLTypes")]
1369        /// The required size of every tile shader threadgroup.
1370        #[unsafe(method(requiredThreadsPerTileThreadgroup))]
1371        #[unsafe(method_family = none)]
1372        fn requiredThreadsPerTileThreadgroup(&self) -> MTLSize;
1373
1374        #[cfg(feature = "MTLTypes")]
1375        /// The required size of every object shader threadgroup.
1376        ///
1377        /// This value is set in MTLMeshRenderPipelineDescriptor.
1378        #[unsafe(method(requiredThreadsPerObjectThreadgroup))]
1379        #[unsafe(method_family = none)]
1380        fn requiredThreadsPerObjectThreadgroup(&self) -> MTLSize;
1381
1382        #[cfg(feature = "MTLTypes")]
1383        /// The required size of every mesh shader threadgroup.
1384        ///
1385        /// This value is set in MTLMeshRenderPipelineDescriptor.
1386        #[unsafe(method(requiredThreadsPerMeshThreadgroup))]
1387        #[unsafe(method_family = none)]
1388        fn requiredThreadsPerMeshThreadgroup(&self) -> MTLSize;
1389    }
1390);
1391
1392extern_class!(
1393    /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlrenderpipelinecolorattachmentdescriptorarray?language=objc)
1394    #[unsafe(super(NSObject))]
1395    #[derive(Debug, PartialEq, Eq, Hash)]
1396    pub struct MTLRenderPipelineColorAttachmentDescriptorArray;
1397);
1398
1399extern_conformance!(
1400    unsafe impl NSObjectProtocol for MTLRenderPipelineColorAttachmentDescriptorArray {}
1401);
1402
1403impl MTLRenderPipelineColorAttachmentDescriptorArray {
1404    extern_methods!(
1405        /// # Safety
1406        ///
1407        /// `attachmentIndex` might not be bounds-checked.
1408        #[unsafe(method(objectAtIndexedSubscript:))]
1409        #[unsafe(method_family = none)]
1410        pub unsafe fn objectAtIndexedSubscript(
1411            &self,
1412            attachment_index: NSUInteger,
1413        ) -> Retained<MTLRenderPipelineColorAttachmentDescriptor>;
1414
1415        /// # Safety
1416        ///
1417        /// `attachmentIndex` might not be bounds-checked.
1418        #[unsafe(method(setObject:atIndexedSubscript:))]
1419        #[unsafe(method_family = none)]
1420        pub unsafe fn setObject_atIndexedSubscript(
1421            &self,
1422            attachment: Option<&MTLRenderPipelineColorAttachmentDescriptor>,
1423            attachment_index: NSUInteger,
1424        );
1425    );
1426}
1427
1428/// Methods declared on superclass `NSObject`.
1429impl MTLRenderPipelineColorAttachmentDescriptorArray {
1430    extern_methods!(
1431        #[unsafe(method(init))]
1432        #[unsafe(method_family = init)]
1433        pub fn init(this: Allocated<Self>) -> Retained<Self>;
1434
1435        #[unsafe(method(new))]
1436        #[unsafe(method_family = new)]
1437        pub fn new() -> Retained<Self>;
1438    );
1439}
1440
1441impl DefaultRetained for MTLRenderPipelineColorAttachmentDescriptorArray {
1442    #[inline]
1443    fn default_retained() -> Retained<Self> {
1444        Self::new()
1445    }
1446}
1447
1448extern_class!(
1449    /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtltilerenderpipelinecolorattachmentdescriptor?language=objc)
1450    #[unsafe(super(NSObject))]
1451    #[derive(Debug, PartialEq, Eq, Hash)]
1452    pub struct MTLTileRenderPipelineColorAttachmentDescriptor;
1453);
1454
1455extern_conformance!(
1456    unsafe impl NSCopying for MTLTileRenderPipelineColorAttachmentDescriptor {}
1457);
1458
1459unsafe impl CopyingHelper for MTLTileRenderPipelineColorAttachmentDescriptor {
1460    type Result = Self;
1461}
1462
1463extern_conformance!(
1464    unsafe impl NSObjectProtocol for MTLTileRenderPipelineColorAttachmentDescriptor {}
1465);
1466
1467impl MTLTileRenderPipelineColorAttachmentDescriptor {
1468    extern_methods!(
1469        #[cfg(feature = "MTLPixelFormat")]
1470        /// Pixel format.  Defaults to MTLPixelFormatInvalid
1471        #[unsafe(method(pixelFormat))]
1472        #[unsafe(method_family = none)]
1473        pub fn pixelFormat(&self) -> MTLPixelFormat;
1474
1475        #[cfg(feature = "MTLPixelFormat")]
1476        /// Setter for [`pixelFormat`][Self::pixelFormat].
1477        #[unsafe(method(setPixelFormat:))]
1478        #[unsafe(method_family = none)]
1479        pub fn setPixelFormat(&self, pixel_format: MTLPixelFormat);
1480    );
1481}
1482
1483/// Methods declared on superclass `NSObject`.
1484impl MTLTileRenderPipelineColorAttachmentDescriptor {
1485    extern_methods!(
1486        #[unsafe(method(init))]
1487        #[unsafe(method_family = init)]
1488        pub fn init(this: Allocated<Self>) -> Retained<Self>;
1489
1490        #[unsafe(method(new))]
1491        #[unsafe(method_family = new)]
1492        pub fn new() -> Retained<Self>;
1493    );
1494}
1495
1496impl DefaultRetained for MTLTileRenderPipelineColorAttachmentDescriptor {
1497    #[inline]
1498    fn default_retained() -> Retained<Self> {
1499        Self::new()
1500    }
1501}
1502
1503extern_class!(
1504    /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtltilerenderpipelinecolorattachmentdescriptorarray?language=objc)
1505    #[unsafe(super(NSObject))]
1506    #[derive(Debug, PartialEq, Eq, Hash)]
1507    pub struct MTLTileRenderPipelineColorAttachmentDescriptorArray;
1508);
1509
1510extern_conformance!(
1511    unsafe impl NSObjectProtocol for MTLTileRenderPipelineColorAttachmentDescriptorArray {}
1512);
1513
1514impl MTLTileRenderPipelineColorAttachmentDescriptorArray {
1515    extern_methods!(
1516        /// # Safety
1517        ///
1518        /// `attachmentIndex` might not be bounds-checked.
1519        #[unsafe(method(objectAtIndexedSubscript:))]
1520        #[unsafe(method_family = none)]
1521        pub unsafe fn objectAtIndexedSubscript(
1522            &self,
1523            attachment_index: NSUInteger,
1524        ) -> Retained<MTLTileRenderPipelineColorAttachmentDescriptor>;
1525
1526        /// # Safety
1527        ///
1528        /// `attachmentIndex` might not be bounds-checked.
1529        #[unsafe(method(setObject:atIndexedSubscript:))]
1530        #[unsafe(method_family = none)]
1531        pub unsafe fn setObject_atIndexedSubscript(
1532            &self,
1533            attachment: &MTLTileRenderPipelineColorAttachmentDescriptor,
1534            attachment_index: NSUInteger,
1535        );
1536    );
1537}
1538
1539/// Methods declared on superclass `NSObject`.
1540impl MTLTileRenderPipelineColorAttachmentDescriptorArray {
1541    extern_methods!(
1542        #[unsafe(method(init))]
1543        #[unsafe(method_family = init)]
1544        pub fn init(this: Allocated<Self>) -> Retained<Self>;
1545
1546        #[unsafe(method(new))]
1547        #[unsafe(method_family = new)]
1548        pub fn new() -> Retained<Self>;
1549    );
1550}
1551
1552impl DefaultRetained for MTLTileRenderPipelineColorAttachmentDescriptorArray {
1553    #[inline]
1554    fn default_retained() -> Retained<Self> {
1555        Self::new()
1556    }
1557}
1558
1559extern_class!(
1560    /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtltilerenderpipelinedescriptor?language=objc)
1561    #[unsafe(super(NSObject))]
1562    #[derive(Debug, PartialEq, Eq, Hash)]
1563    pub struct MTLTileRenderPipelineDescriptor;
1564);
1565
1566extern_conformance!(
1567    unsafe impl NSCopying for MTLTileRenderPipelineDescriptor {}
1568);
1569
1570unsafe impl CopyingHelper for MTLTileRenderPipelineDescriptor {
1571    type Result = Self;
1572}
1573
1574extern_conformance!(
1575    unsafe impl NSObjectProtocol for MTLTileRenderPipelineDescriptor {}
1576);
1577
1578impl MTLTileRenderPipelineDescriptor {
1579    extern_methods!(
1580        /// The descriptor label.
1581        #[unsafe(method(label))]
1582        #[unsafe(method_family = none)]
1583        pub fn label(&self) -> Option<Retained<NSString>>;
1584
1585        /// Setter for [`label`][Self::label].
1586        ///
1587        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
1588        #[unsafe(method(setLabel:))]
1589        #[unsafe(method_family = none)]
1590        pub fn setLabel(&self, label: Option<&NSString>);
1591
1592        #[cfg(feature = "MTLLibrary")]
1593        /// The kernel or fragment function that serves as the tile shader for this pipeline.
1594        ///
1595        /// Both kernel-based and fragment-based tile pipelines dispatches will barrier against previous
1596        /// draws and other dispatches. Kernel-based pipelines will wait until all prior access to the tile completes.
1597        /// Fragment-based pipelines will only wait until all prior access to the fragment's location completes.
1598        #[unsafe(method(tileFunction))]
1599        #[unsafe(method_family = none)]
1600        pub fn tileFunction(&self) -> Retained<ProtocolObject<dyn MTLFunction>>;
1601
1602        #[cfg(feature = "MTLLibrary")]
1603        /// Setter for [`tileFunction`][Self::tileFunction].
1604        ///
1605        /// # Safety
1606        ///
1607        /// - `tile_function` must be safe to call.
1608        /// - `tile_function` must have the correct argument and return types.
1609        #[unsafe(method(setTileFunction:))]
1610        #[unsafe(method_family = none)]
1611        pub unsafe fn setTileFunction(&self, tile_function: &ProtocolObject<dyn MTLFunction>);
1612
1613        #[unsafe(method(rasterSampleCount))]
1614        #[unsafe(method_family = none)]
1615        pub fn rasterSampleCount(&self) -> NSUInteger;
1616
1617        /// Setter for [`rasterSampleCount`][Self::rasterSampleCount].
1618        ///
1619        /// # Safety
1620        ///
1621        /// This might not be bounds-checked.
1622        #[unsafe(method(setRasterSampleCount:))]
1623        #[unsafe(method_family = none)]
1624        pub unsafe fn setRasterSampleCount(&self, raster_sample_count: NSUInteger);
1625
1626        #[unsafe(method(colorAttachments))]
1627        #[unsafe(method_family = none)]
1628        pub fn colorAttachments(
1629            &self,
1630        ) -> Retained<MTLTileRenderPipelineColorAttachmentDescriptorArray>;
1631
1632        /// Whether all threadgroups associated with this pipeline will cover tiles entirely.
1633        ///
1634        /// Metal can optimize code generation for this case.
1635        #[unsafe(method(threadgroupSizeMatchesTileSize))]
1636        #[unsafe(method_family = none)]
1637        pub fn threadgroupSizeMatchesTileSize(&self) -> bool;
1638
1639        /// Setter for [`threadgroupSizeMatchesTileSize`][Self::threadgroupSizeMatchesTileSize].
1640        #[unsafe(method(setThreadgroupSizeMatchesTileSize:))]
1641        #[unsafe(method_family = none)]
1642        pub fn setThreadgroupSizeMatchesTileSize(&self, threadgroup_size_matches_tile_size: bool);
1643
1644        #[cfg(feature = "MTLPipeline")]
1645        #[unsafe(method(tileBuffers))]
1646        #[unsafe(method_family = none)]
1647        pub fn tileBuffers(&self) -> Retained<MTLPipelineBufferDescriptorArray>;
1648
1649        /// Optional property. Set the maxTotalThreadsPerThreadgroup. If it is not set, returns zero.
1650        #[unsafe(method(maxTotalThreadsPerThreadgroup))]
1651        #[unsafe(method_family = none)]
1652        pub fn maxTotalThreadsPerThreadgroup(&self) -> NSUInteger;
1653
1654        /// Setter for [`maxTotalThreadsPerThreadgroup`][Self::maxTotalThreadsPerThreadgroup].
1655        #[unsafe(method(setMaxTotalThreadsPerThreadgroup:))]
1656        #[unsafe(method_family = none)]
1657        pub fn setMaxTotalThreadsPerThreadgroup(
1658            &self,
1659            max_total_threads_per_threadgroup: NSUInteger,
1660        );
1661
1662        #[cfg(feature = "MTLBinaryArchive")]
1663        /// The set of MTLBinaryArchive to search for compiled code when creating the pipeline state.
1664        ///
1665        /// Accelerate pipeline state creation by providing archives of compiled code such that no compilation needs to happen on the fast path.
1666        ///
1667        /// See: MTLBinaryArchive
1668        #[unsafe(method(binaryArchives))]
1669        #[unsafe(method_family = none)]
1670        pub fn binaryArchives(
1671            &self,
1672        ) -> Option<Retained<NSArray<ProtocolObject<dyn MTLBinaryArchive>>>>;
1673
1674        #[cfg(feature = "MTLBinaryArchive")]
1675        /// Setter for [`binaryArchives`][Self::binaryArchives].
1676        ///
1677        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
1678        #[unsafe(method(setBinaryArchives:))]
1679        #[unsafe(method_family = none)]
1680        pub fn setBinaryArchives(
1681            &self,
1682            binary_archives: Option<&NSArray<ProtocolObject<dyn MTLBinaryArchive>>>,
1683        );
1684
1685        #[cfg(feature = "MTLDynamicLibrary")]
1686        /// The set of MTLDynamicLibrary to use to resolve external symbols before considering symbols from dependent MTLDynamicLibrary.
1687        ///
1688        /// Typical workflows use the libraries property of MTLCompileOptions to record dependent libraries at compile time without having to use preloadedLibraries.
1689        /// This property can be used to override symbols from dependent libraries for experimentation or evaluating alternative implementations.
1690        /// It can also be used to provide dynamic libraries that are dynamically created (for example, from source) that have no stable installName that can be used to automatically load from the file system.
1691        ///
1692        /// See: MTLDynamicLibrary
1693        #[unsafe(method(preloadedLibraries))]
1694        #[unsafe(method_family = none)]
1695        pub fn preloadedLibraries(
1696            &self,
1697        ) -> Retained<NSArray<ProtocolObject<dyn MTLDynamicLibrary>>>;
1698
1699        #[cfg(feature = "MTLDynamicLibrary")]
1700        /// Setter for [`preloadedLibraries`][Self::preloadedLibraries].
1701        ///
1702        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
1703        #[unsafe(method(setPreloadedLibraries:))]
1704        #[unsafe(method_family = none)]
1705        pub fn setPreloadedLibraries(
1706            &self,
1707            preloaded_libraries: &NSArray<ProtocolObject<dyn MTLDynamicLibrary>>,
1708        );
1709
1710        #[cfg(feature = "MTLLinkedFunctions")]
1711        /// The set of functions to be linked with the pipeline state and accessed from the tile function.
1712        ///
1713        /// See: MTLLinkedFunctions
1714        #[unsafe(method(linkedFunctions))]
1715        #[unsafe(method_family = none)]
1716        pub fn linkedFunctions(&self) -> Retained<MTLLinkedFunctions>;
1717
1718        #[cfg(feature = "MTLLinkedFunctions")]
1719        /// Setter for [`linkedFunctions`][Self::linkedFunctions].
1720        ///
1721        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
1722        #[unsafe(method(setLinkedFunctions:))]
1723        #[unsafe(method_family = none)]
1724        pub fn setLinkedFunctions(&self, linked_functions: Option<&MTLLinkedFunctions>);
1725
1726        /// This flag makes this pipeline support creating a new pipeline by adding binary functions.
1727        #[unsafe(method(supportAddingBinaryFunctions))]
1728        #[unsafe(method_family = none)]
1729        pub fn supportAddingBinaryFunctions(&self) -> bool;
1730
1731        /// Setter for [`supportAddingBinaryFunctions`][Self::supportAddingBinaryFunctions].
1732        #[unsafe(method(setSupportAddingBinaryFunctions:))]
1733        #[unsafe(method_family = none)]
1734        pub fn setSupportAddingBinaryFunctions(&self, support_adding_binary_functions: bool);
1735
1736        /// The maximum depth of the call stack in stack frames from the tile function. Defaults to 1 additional stack frame.
1737        #[unsafe(method(maxCallStackDepth))]
1738        #[unsafe(method_family = none)]
1739        pub fn maxCallStackDepth(&self) -> NSUInteger;
1740
1741        /// Setter for [`maxCallStackDepth`][Self::maxCallStackDepth].
1742        #[unsafe(method(setMaxCallStackDepth:))]
1743        #[unsafe(method_family = none)]
1744        pub fn setMaxCallStackDepth(&self, max_call_stack_depth: NSUInteger);
1745
1746        #[unsafe(method(reset))]
1747        #[unsafe(method_family = none)]
1748        pub fn reset(&self);
1749
1750        #[cfg(feature = "MTLPipeline")]
1751        /// Toggle that determines whether Metal Shader Validation should be enabled or disabled for the pipeline.
1752        ///
1753        /// The value can be overridden using `MTL_SHADER_VALIDATION_ENABLE_PIPELINES` or `MTL_SHADER_VALIDATION_DISABLE_PIPELINES` Environment Variables.
1754        #[unsafe(method(shaderValidation))]
1755        #[unsafe(method_family = none)]
1756        pub fn shaderValidation(&self) -> MTLShaderValidation;
1757
1758        #[cfg(feature = "MTLPipeline")]
1759        /// Setter for [`shaderValidation`][Self::shaderValidation].
1760        #[unsafe(method(setShaderValidation:))]
1761        #[unsafe(method_family = none)]
1762        pub fn setShaderValidation(&self, shader_validation: MTLShaderValidation);
1763
1764        #[cfg(feature = "MTLTypes")]
1765        /// Sets the required threads-per-threadgroup during tile dispatches. The `threadsPerTile` argument of any tile dispatch must match to this value if it is set.
1766        /// Optional, unless the pipeline is going to use CooperativeTensors in which case this must be set.
1767        /// Setting this to a size of 0 in every dimension disables this property
1768        #[unsafe(method(requiredThreadsPerThreadgroup))]
1769        #[unsafe(method_family = none)]
1770        pub fn requiredThreadsPerThreadgroup(&self) -> MTLSize;
1771
1772        #[cfg(feature = "MTLTypes")]
1773        /// Setter for [`requiredThreadsPerThreadgroup`][Self::requiredThreadsPerThreadgroup].
1774        #[unsafe(method(setRequiredThreadsPerThreadgroup:))]
1775        #[unsafe(method_family = none)]
1776        pub fn setRequiredThreadsPerThreadgroup(&self, required_threads_per_threadgroup: MTLSize);
1777    );
1778}
1779
1780/// Methods declared on superclass `NSObject`.
1781impl MTLTileRenderPipelineDescriptor {
1782    extern_methods!(
1783        #[unsafe(method(init))]
1784        #[unsafe(method_family = init)]
1785        pub fn init(this: Allocated<Self>) -> Retained<Self>;
1786
1787        #[unsafe(method(new))]
1788        #[unsafe(method_family = new)]
1789        pub fn new() -> Retained<Self>;
1790    );
1791}
1792
1793impl DefaultRetained for MTLTileRenderPipelineDescriptor {
1794    #[inline]
1795    fn default_retained() -> Retained<Self> {
1796        Self::new()
1797    }
1798}
1799
1800extern_class!(
1801    /// As an alternative to a vertex + fragment shader render pipeline, this render pipeline uses a (object +) mesh + fragment shader for rendering geometry.
1802    ///
1803    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlmeshrenderpipelinedescriptor?language=objc)
1804    #[unsafe(super(NSObject))]
1805    #[derive(Debug, PartialEq, Eq, Hash)]
1806    pub struct MTLMeshRenderPipelineDescriptor;
1807);
1808
1809extern_conformance!(
1810    unsafe impl NSCopying for MTLMeshRenderPipelineDescriptor {}
1811);
1812
1813unsafe impl CopyingHelper for MTLMeshRenderPipelineDescriptor {
1814    type Result = Self;
1815}
1816
1817extern_conformance!(
1818    unsafe impl NSObjectProtocol for MTLMeshRenderPipelineDescriptor {}
1819);
1820
1821impl MTLMeshRenderPipelineDescriptor {
1822    extern_methods!(
1823        /// A name or description provided by the application that will be displayed in debugging tools.
1824        /// The default value is nil.
1825        #[unsafe(method(label))]
1826        #[unsafe(method_family = none)]
1827        pub fn label(&self) -> Option<Retained<NSString>>;
1828
1829        /// Setter for [`label`][Self::label].
1830        ///
1831        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
1832        #[unsafe(method(setLabel:))]
1833        #[unsafe(method_family = none)]
1834        pub fn setLabel(&self, label: Option<&NSString>);
1835
1836        #[cfg(feature = "MTLLibrary")]
1837        /// Optional shader function responsible for determining how many threadgroups of the mesh shader to run, can optionally provide payload data for the mesh stage.
1838        /// If this is nil, no payload data is available to the mesh function, and the draw command determines how many threadgroups of the mesh stage to run.
1839        /// The default value is nil.
1840        #[unsafe(method(objectFunction))]
1841        #[unsafe(method_family = none)]
1842        pub fn objectFunction(&self) -> Option<Retained<ProtocolObject<dyn MTLFunction>>>;
1843
1844        #[cfg(feature = "MTLLibrary")]
1845        /// Setter for [`objectFunction`][Self::objectFunction].
1846        ///
1847        /// # Safety
1848        ///
1849        /// - `object_function` must be safe to call.
1850        /// - `object_function` must have the correct argument and return types.
1851        #[unsafe(method(setObjectFunction:))]
1852        #[unsafe(method_family = none)]
1853        pub unsafe fn setObjectFunction(
1854            &self,
1855            object_function: Option<&ProtocolObject<dyn MTLFunction>>,
1856        );
1857
1858        #[cfg(feature = "MTLLibrary")]
1859        /// Shader function responsible for exporting a chunk of geometry per threadgroup for the rasterizer.
1860        /// The default value is nil.
1861        #[unsafe(method(meshFunction))]
1862        #[unsafe(method_family = none)]
1863        pub fn meshFunction(&self) -> Option<Retained<ProtocolObject<dyn MTLFunction>>>;
1864
1865        #[cfg(feature = "MTLLibrary")]
1866        /// Setter for [`meshFunction`][Self::meshFunction].
1867        ///
1868        /// # Safety
1869        ///
1870        /// - `mesh_function` must be safe to call.
1871        /// - `mesh_function` must have the correct argument and return types.
1872        #[unsafe(method(setMeshFunction:))]
1873        #[unsafe(method_family = none)]
1874        pub unsafe fn setMeshFunction(
1875            &self,
1876            mesh_function: Option<&ProtocolObject<dyn MTLFunction>>,
1877        );
1878
1879        #[cfg(feature = "MTLLibrary")]
1880        /// Like a classical render pipeline, this fragments covered by the rasterized geometry are shaded with this function.
1881        /// The default value is nil. To create a pipeline, you must either set fragmentFunction to non-nil, or set rasterizationEnabled to NO.
1882        #[unsafe(method(fragmentFunction))]
1883        #[unsafe(method_family = none)]
1884        pub fn fragmentFunction(&self) -> Option<Retained<ProtocolObject<dyn MTLFunction>>>;
1885
1886        #[cfg(feature = "MTLLibrary")]
1887        /// Setter for [`fragmentFunction`][Self::fragmentFunction].
1888        ///
1889        /// # Safety
1890        ///
1891        /// - `fragment_function` must be safe to call.
1892        /// - `fragment_function` must have the correct argument and return types.
1893        #[unsafe(method(setFragmentFunction:))]
1894        #[unsafe(method_family = none)]
1895        pub unsafe fn setFragmentFunction(
1896            &self,
1897            fragment_function: Option<&ProtocolObject<dyn MTLFunction>>,
1898        );
1899
1900        /// The maximum size of the product of threadsPerObjectThreadgroup that can be used for draws with this pipeline.
1901        /// This information can be used by the optimizer to generate more efficient code, specifically when the specified value does not exceed the thread execution width of the underlying GPU.
1902        /// The default value is 0, which means that the value specified with the [[max_total_threads_per_threadgroup(N)]] specified on objectFunction will be used.
1903        /// When both the [[max_total_threads_per_threadgroup(N)]] attribute and a non-zero value are specified, both values must match.
1904        /// Any value specified cannot exceed the device limit as documented in the "Metal Feature Set Tables" for "Maximum threads per threadgroup".
1905        #[unsafe(method(maxTotalThreadsPerObjectThreadgroup))]
1906        #[unsafe(method_family = none)]
1907        pub fn maxTotalThreadsPerObjectThreadgroup(&self) -> NSUInteger;
1908
1909        /// Setter for [`maxTotalThreadsPerObjectThreadgroup`][Self::maxTotalThreadsPerObjectThreadgroup].
1910        #[unsafe(method(setMaxTotalThreadsPerObjectThreadgroup:))]
1911        #[unsafe(method_family = none)]
1912        pub fn setMaxTotalThreadsPerObjectThreadgroup(
1913            &self,
1914            max_total_threads_per_object_threadgroup: NSUInteger,
1915        );
1916
1917        /// The maximum size of the product of threadsPerMeshThreadgroup that can be used for draws with this pipeline.
1918        /// This information can be used by the optimizer to generate more efficient code, specifically when the specified value does not exceed the thread execution width of the underlying GPU.
1919        /// The default value is 0, which means that the value specified with the [[max_total_threads_per_threadgroup(N)]] specified on meshFunction will be used.
1920        /// When both the [[max_total_threads_per_threadgroup(N)]] attribute and a non-zero value are specified, both values must match.
1921        /// Any value specified cannot exceed the device limit as documented in the "Metal Feature Set Tables" for "Maximum threads per threadgroup".
1922        #[unsafe(method(maxTotalThreadsPerMeshThreadgroup))]
1923        #[unsafe(method_family = none)]
1924        pub fn maxTotalThreadsPerMeshThreadgroup(&self) -> NSUInteger;
1925
1926        /// Setter for [`maxTotalThreadsPerMeshThreadgroup`][Self::maxTotalThreadsPerMeshThreadgroup].
1927        #[unsafe(method(setMaxTotalThreadsPerMeshThreadgroup:))]
1928        #[unsafe(method_family = none)]
1929        pub fn setMaxTotalThreadsPerMeshThreadgroup(
1930            &self,
1931            max_total_threads_per_mesh_threadgroup: NSUInteger,
1932        );
1933
1934        /// Set this value to YES when you will only use draws with the product of threadsPerObjectThreadgroup set to a multiple of the objectThreadExecutionWidth of the returned pipeline state.
1935        /// This information can be used by the optimizer to generate more efficient code.
1936        /// The default value is NO.
1937        #[unsafe(method(objectThreadgroupSizeIsMultipleOfThreadExecutionWidth))]
1938        #[unsafe(method_family = none)]
1939        pub fn objectThreadgroupSizeIsMultipleOfThreadExecutionWidth(&self) -> bool;
1940
1941        /// Setter for [`objectThreadgroupSizeIsMultipleOfThreadExecutionWidth`][Self::objectThreadgroupSizeIsMultipleOfThreadExecutionWidth].
1942        #[unsafe(method(setObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth:))]
1943        #[unsafe(method_family = none)]
1944        pub fn setObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth(
1945            &self,
1946            object_threadgroup_size_is_multiple_of_thread_execution_width: bool,
1947        );
1948
1949        /// Set this value to YES when you will only use draws with the product of threadsPerMeshThreadgroup set to a multiple of the meshThreadExecutionWidth of the returned pipeline state.
1950        /// This information can be used by the optimizer to generate more efficient code.
1951        /// The default value is NO.
1952        #[unsafe(method(meshThreadgroupSizeIsMultipleOfThreadExecutionWidth))]
1953        #[unsafe(method_family = none)]
1954        pub fn meshThreadgroupSizeIsMultipleOfThreadExecutionWidth(&self) -> bool;
1955
1956        /// Setter for [`meshThreadgroupSizeIsMultipleOfThreadExecutionWidth`][Self::meshThreadgroupSizeIsMultipleOfThreadExecutionWidth].
1957        #[unsafe(method(setMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth:))]
1958        #[unsafe(method_family = none)]
1959        pub fn setMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth(
1960            &self,
1961            mesh_threadgroup_size_is_multiple_of_thread_execution_width: bool,
1962        );
1963
1964        /// The size, in bytes, of the buffer indicated by [[payload]] in the object and mesh shader.
1965        /// If this value is 0, the size of the dereferenced type declared in the object shader for the buffer is used (space for a single element is assumed for pointers).
1966        /// The default value is 0.
1967        #[unsafe(method(payloadMemoryLength))]
1968        #[unsafe(method_family = none)]
1969        pub fn payloadMemoryLength(&self) -> NSUInteger;
1970
1971        /// Setter for [`payloadMemoryLength`][Self::payloadMemoryLength].
1972        #[unsafe(method(setPayloadMemoryLength:))]
1973        #[unsafe(method_family = none)]
1974        pub fn setPayloadMemoryLength(&self, payload_memory_length: NSUInteger);
1975
1976        /// The maximum value of the product of vector elements that the object shader may pass to the mesh_grid_properties::set_threadgroups_per_grid built-in function.
1977        /// The default value is 0, which means that the value specified with the [[max_total_threadgroups_per_mesh_grid(N)]] specified on objectFunction will be used.
1978        /// When both the [[max_total_threadgroups_per_mesh_grid(N)]] attribute and a non-zero value are specified, both values must match.
1979        /// Any value specified cannot exceed the device limit as documented in the "Metal Feature Set Tables" for "Maximum threadgroups per mesh grid".
1980        /// Specifying this value is optional; it may be used to improve scheduling of the workload. If neither this value nor the shader attribute are used, the device's maximum supported value is used instead.
1981        #[unsafe(method(maxTotalThreadgroupsPerMeshGrid))]
1982        #[unsafe(method_family = none)]
1983        pub fn maxTotalThreadgroupsPerMeshGrid(&self) -> NSUInteger;
1984
1985        /// Setter for [`maxTotalThreadgroupsPerMeshGrid`][Self::maxTotalThreadgroupsPerMeshGrid].
1986        #[unsafe(method(setMaxTotalThreadgroupsPerMeshGrid:))]
1987        #[unsafe(method_family = none)]
1988        pub fn setMaxTotalThreadgroupsPerMeshGrid(
1989            &self,
1990            max_total_threadgroups_per_mesh_grid: NSUInteger,
1991        );
1992
1993        #[cfg(feature = "MTLPipeline")]
1994        /// Provide mutability information on the buffers used by objectFunction.
1995        ///
1996        /// Specifying these values is optional; it may be used to optimize the shader code.
1997        #[unsafe(method(objectBuffers))]
1998        #[unsafe(method_family = none)]
1999        pub fn objectBuffers(&self) -> Retained<MTLPipelineBufferDescriptorArray>;
2000
2001        #[cfg(feature = "MTLPipeline")]
2002        /// Provide mutability information on the buffers used by meshFunction.
2003        ///
2004        /// Specifying these values is optional; it may be used to optimize the shader code.
2005        #[unsafe(method(meshBuffers))]
2006        #[unsafe(method_family = none)]
2007        pub fn meshBuffers(&self) -> Retained<MTLPipelineBufferDescriptorArray>;
2008
2009        #[cfg(feature = "MTLPipeline")]
2010        /// Provide mutability information on the buffers used by fragmentFunction.
2011        ///
2012        /// Specifying these values is optional; it may be used to optimize the shader code.
2013        #[unsafe(method(fragmentBuffers))]
2014        #[unsafe(method_family = none)]
2015        pub fn fragmentBuffers(&self) -> Retained<MTLPipelineBufferDescriptorArray>;
2016
2017        /// The number of samples per fragment of the render pass in which this pipeline will be used.
2018        #[unsafe(method(rasterSampleCount))]
2019        #[unsafe(method_family = none)]
2020        pub fn rasterSampleCount(&self) -> NSUInteger;
2021
2022        /// Setter for [`rasterSampleCount`][Self::rasterSampleCount].
2023        ///
2024        /// # Safety
2025        ///
2026        /// This might not be bounds-checked.
2027        #[unsafe(method(setRasterSampleCount:))]
2028        #[unsafe(method_family = none)]
2029        pub unsafe fn setRasterSampleCount(&self, raster_sample_count: NSUInteger);
2030
2031        /// Whether the alpha value exported by the fragment shader for the first color attachment is converted to a sample mask, which is subsequently AND-ed with the fragments' sample mask
2032        ///
2033        /// The default value is NO.
2034        #[unsafe(method(isAlphaToCoverageEnabled))]
2035        #[unsafe(method_family = none)]
2036        pub fn isAlphaToCoverageEnabled(&self) -> bool;
2037
2038        /// Setter for [`isAlphaToCoverageEnabled`][Self::isAlphaToCoverageEnabled].
2039        #[unsafe(method(setAlphaToCoverageEnabled:))]
2040        #[unsafe(method_family = none)]
2041        pub fn setAlphaToCoverageEnabled(&self, alpha_to_coverage_enabled: bool);
2042
2043        /// Whether the alpha value exported by the fragment shader for all color attachments is modified to 1 (after evaluating alphaToCoverage).
2044        ///
2045        /// The default value is NO.
2046        #[unsafe(method(isAlphaToOneEnabled))]
2047        #[unsafe(method_family = none)]
2048        pub fn isAlphaToOneEnabled(&self) -> bool;
2049
2050        /// Setter for [`isAlphaToOneEnabled`][Self::isAlphaToOneEnabled].
2051        #[unsafe(method(setAlphaToOneEnabled:))]
2052        #[unsafe(method_family = none)]
2053        pub fn setAlphaToOneEnabled(&self, alpha_to_one_enabled: bool);
2054
2055        /// Whether rasterization is disabled, all primitives are dropped prior to rasterization.
2056        ///
2057        /// The default value is YES.
2058        #[unsafe(method(isRasterizationEnabled))]
2059        #[unsafe(method_family = none)]
2060        pub fn isRasterizationEnabled(&self) -> bool;
2061
2062        /// Setter for [`isRasterizationEnabled`][Self::isRasterizationEnabled].
2063        #[unsafe(method(setRasterizationEnabled:))]
2064        #[unsafe(method_family = none)]
2065        pub fn setRasterizationEnabled(&self, rasterization_enabled: bool);
2066
2067        /// The maximum value that can be passed to setVertexAmplificationCount when using this pipeline.
2068        ///
2069        /// The default value is 1. The value must be supported by the device, which can be checked with supportsVertexAmplificationCount.
2070        #[unsafe(method(maxVertexAmplificationCount))]
2071        #[unsafe(method_family = none)]
2072        pub fn maxVertexAmplificationCount(&self) -> NSUInteger;
2073
2074        /// Setter for [`maxVertexAmplificationCount`][Self::maxVertexAmplificationCount].
2075        ///
2076        /// # Safety
2077        ///
2078        /// This might not be bounds-checked.
2079        #[unsafe(method(setMaxVertexAmplificationCount:))]
2080        #[unsafe(method_family = none)]
2081        pub unsafe fn setMaxVertexAmplificationCount(
2082            &self,
2083            max_vertex_amplification_count: NSUInteger,
2084        );
2085
2086        /// Describes the color attachments of the render pass in which this pipeline will be used.
2087        #[unsafe(method(colorAttachments))]
2088        #[unsafe(method_family = none)]
2089        pub fn colorAttachments(&self)
2090            -> Retained<MTLRenderPipelineColorAttachmentDescriptorArray>;
2091
2092        #[cfg(feature = "MTLPixelFormat")]
2093        /// The pixel format of the depth attachment of the render pass in which this pipeline will be used.
2094        ///
2095        /// The default value is MTLPixelFormatInvalid; indicating no depth attachment will be used.
2096        #[unsafe(method(depthAttachmentPixelFormat))]
2097        #[unsafe(method_family = none)]
2098        pub fn depthAttachmentPixelFormat(&self) -> MTLPixelFormat;
2099
2100        #[cfg(feature = "MTLPixelFormat")]
2101        /// Setter for [`depthAttachmentPixelFormat`][Self::depthAttachmentPixelFormat].
2102        #[unsafe(method(setDepthAttachmentPixelFormat:))]
2103        #[unsafe(method_family = none)]
2104        pub fn setDepthAttachmentPixelFormat(&self, depth_attachment_pixel_format: MTLPixelFormat);
2105
2106        #[cfg(feature = "MTLPixelFormat")]
2107        /// The pixel format of the stencil attachment of the render pass in which this pipeline will be used.
2108        ///
2109        /// The default value is MTLPixelFormatInvalid; indicating no stencil attachment will be used.
2110        #[unsafe(method(stencilAttachmentPixelFormat))]
2111        #[unsafe(method_family = none)]
2112        pub fn stencilAttachmentPixelFormat(&self) -> MTLPixelFormat;
2113
2114        #[cfg(feature = "MTLPixelFormat")]
2115        /// Setter for [`stencilAttachmentPixelFormat`][Self::stencilAttachmentPixelFormat].
2116        #[unsafe(method(setStencilAttachmentPixelFormat:))]
2117        #[unsafe(method_family = none)]
2118        pub fn setStencilAttachmentPixelFormat(
2119            &self,
2120            stencil_attachment_pixel_format: MTLPixelFormat,
2121        );
2122
2123        /// Whether this pipeline will support being used by commands in an indirect command buffer.
2124        ///
2125        /// The default value is NO.
2126        #[unsafe(method(supportIndirectCommandBuffers))]
2127        #[unsafe(method_family = none)]
2128        pub fn supportIndirectCommandBuffers(&self) -> bool;
2129
2130        /// Setter for [`supportIndirectCommandBuffers`][Self::supportIndirectCommandBuffers].
2131        #[unsafe(method(setSupportIndirectCommandBuffers:))]
2132        #[unsafe(method_family = none)]
2133        pub fn setSupportIndirectCommandBuffers(&self, support_indirect_command_buffers: bool);
2134
2135        #[cfg(feature = "MTLBinaryArchive")]
2136        /// The set of MTLBinaryArchive to search for compiled code when creating the pipeline state.
2137        ///
2138        /// Accelerate pipeline state creation by providing archives of compiled code such that no compilation needs to happen on the fast path.
2139        ///
2140        /// See: MTLBinaryArchive
2141        #[unsafe(method(binaryArchives))]
2142        #[unsafe(method_family = none)]
2143        pub fn binaryArchives(
2144            &self,
2145        ) -> Option<Retained<NSArray<ProtocolObject<dyn MTLBinaryArchive>>>>;
2146
2147        #[cfg(feature = "MTLBinaryArchive")]
2148        /// Setter for [`binaryArchives`][Self::binaryArchives].
2149        ///
2150        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
2151        #[unsafe(method(setBinaryArchives:))]
2152        #[unsafe(method_family = none)]
2153        pub fn setBinaryArchives(
2154            &self,
2155            binary_archives: Option<&NSArray<ProtocolObject<dyn MTLBinaryArchive>>>,
2156        );
2157
2158        #[cfg(feature = "MTLLinkedFunctions")]
2159        /// The set of functions to be linked with the pipeline state and accessed from the object function.
2160        ///
2161        /// See: MTLLinkedFunctions
2162        #[unsafe(method(objectLinkedFunctions))]
2163        #[unsafe(method_family = none)]
2164        pub fn objectLinkedFunctions(&self) -> Retained<MTLLinkedFunctions>;
2165
2166        #[cfg(feature = "MTLLinkedFunctions")]
2167        /// Setter for [`objectLinkedFunctions`][Self::objectLinkedFunctions].
2168        ///
2169        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
2170        #[unsafe(method(setObjectLinkedFunctions:))]
2171        #[unsafe(method_family = none)]
2172        pub fn setObjectLinkedFunctions(
2173            &self,
2174            object_linked_functions: Option<&MTLLinkedFunctions>,
2175        );
2176
2177        #[cfg(feature = "MTLLinkedFunctions")]
2178        /// The set of functions to be linked with the pipeline state and accessed from the mesh function.
2179        ///
2180        /// See: MTLLinkedFunctions
2181        #[unsafe(method(meshLinkedFunctions))]
2182        #[unsafe(method_family = none)]
2183        pub fn meshLinkedFunctions(&self) -> Retained<MTLLinkedFunctions>;
2184
2185        #[cfg(feature = "MTLLinkedFunctions")]
2186        /// Setter for [`meshLinkedFunctions`][Self::meshLinkedFunctions].
2187        ///
2188        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
2189        #[unsafe(method(setMeshLinkedFunctions:))]
2190        #[unsafe(method_family = none)]
2191        pub fn setMeshLinkedFunctions(&self, mesh_linked_functions: Option<&MTLLinkedFunctions>);
2192
2193        #[cfg(feature = "MTLLinkedFunctions")]
2194        /// The set of functions to be linked with the pipeline state and accessed from the fragment function.
2195        ///
2196        /// See: MTLLinkedFunctions
2197        #[unsafe(method(fragmentLinkedFunctions))]
2198        #[unsafe(method_family = none)]
2199        pub fn fragmentLinkedFunctions(&self) -> Retained<MTLLinkedFunctions>;
2200
2201        #[cfg(feature = "MTLLinkedFunctions")]
2202        /// Setter for [`fragmentLinkedFunctions`][Self::fragmentLinkedFunctions].
2203        ///
2204        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
2205        #[unsafe(method(setFragmentLinkedFunctions:))]
2206        #[unsafe(method_family = none)]
2207        pub fn setFragmentLinkedFunctions(
2208            &self,
2209            fragment_linked_functions: Option<&MTLLinkedFunctions>,
2210        );
2211
2212        /// Restore all mesh pipeline descriptor properties to their default values.
2213        #[unsafe(method(reset))]
2214        #[unsafe(method_family = none)]
2215        pub fn reset(&self);
2216
2217        #[cfg(feature = "MTLPipeline")]
2218        /// Toggle that determines whether Metal Shader Validation should be enabled or disabled for the pipeline.
2219        ///
2220        /// The value can be overridden using `MTL_SHADER_VALIDATION_ENABLE_PIPELINES` or `MTL_SHADER_VALIDATION_DISABLE_PIPELINES` Environment Variables.
2221        #[unsafe(method(shaderValidation))]
2222        #[unsafe(method_family = none)]
2223        pub fn shaderValidation(&self) -> MTLShaderValidation;
2224
2225        #[cfg(feature = "MTLPipeline")]
2226        /// Setter for [`shaderValidation`][Self::shaderValidation].
2227        #[unsafe(method(setShaderValidation:))]
2228        #[unsafe(method_family = none)]
2229        pub fn setShaderValidation(&self, shader_validation: MTLShaderValidation);
2230
2231        #[cfg(feature = "MTLTypes")]
2232        /// Sets the required object threads-per-threadgroup during mesh draws. The `threadsPerObjectThreadgroup` argument of any draw must match to this value if it is set.
2233        /// Optional, unless the pipeline is going to use CooperativeTensors in which case this must be set.
2234        /// Setting this to a size of 0 in every dimension disables this property
2235        #[unsafe(method(requiredThreadsPerObjectThreadgroup))]
2236        #[unsafe(method_family = none)]
2237        pub fn requiredThreadsPerObjectThreadgroup(&self) -> MTLSize;
2238
2239        #[cfg(feature = "MTLTypes")]
2240        /// Setter for [`requiredThreadsPerObjectThreadgroup`][Self::requiredThreadsPerObjectThreadgroup].
2241        #[unsafe(method(setRequiredThreadsPerObjectThreadgroup:))]
2242        #[unsafe(method_family = none)]
2243        pub fn setRequiredThreadsPerObjectThreadgroup(
2244            &self,
2245            required_threads_per_object_threadgroup: MTLSize,
2246        );
2247
2248        #[cfg(feature = "MTLTypes")]
2249        /// Sets the required mesh threads-per-threadgroup during mesh draws. The `threadsPerMeshThreadgroup` argument of any draw must match to this value if it is set.
2250        /// Optional, unless the pipeline is going to use CooperativeTensors in which case this must be set.
2251        /// Setting this to a size of 0 in every dimension disables this property
2252        #[unsafe(method(requiredThreadsPerMeshThreadgroup))]
2253        #[unsafe(method_family = none)]
2254        pub fn requiredThreadsPerMeshThreadgroup(&self) -> MTLSize;
2255
2256        #[cfg(feature = "MTLTypes")]
2257        /// Setter for [`requiredThreadsPerMeshThreadgroup`][Self::requiredThreadsPerMeshThreadgroup].
2258        #[unsafe(method(setRequiredThreadsPerMeshThreadgroup:))]
2259        #[unsafe(method_family = none)]
2260        pub fn setRequiredThreadsPerMeshThreadgroup(
2261            &self,
2262            required_threads_per_mesh_threadgroup: MTLSize,
2263        );
2264    );
2265}
2266
2267/// Methods declared on superclass `NSObject`.
2268impl MTLMeshRenderPipelineDescriptor {
2269    extern_methods!(
2270        #[unsafe(method(init))]
2271        #[unsafe(method_family = init)]
2272        pub fn init(this: Allocated<Self>) -> Retained<Self>;
2273
2274        #[unsafe(method(new))]
2275        #[unsafe(method_family = new)]
2276        pub fn new() -> Retained<Self>;
2277    );
2278}
2279
2280impl DefaultRetained for MTLMeshRenderPipelineDescriptor {
2281    #[inline]
2282    fn default_retained() -> Retained<Self> {
2283        Self::new()
2284    }
2285}