//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTLBlendFactor(pub NSUInteger);
impl MTLBlendFactor {
    #[doc(alias = "MTLBlendFactorZero")]
    pub const Zero: Self = Self(0);
    #[doc(alias = "MTLBlendFactorOne")]
    pub const One: Self = Self(1);
    #[doc(alias = "MTLBlendFactorSourceColor")]
    pub const SourceColor: Self = Self(2);
    #[doc(alias = "MTLBlendFactorOneMinusSourceColor")]
    pub const OneMinusSourceColor: Self = Self(3);
    #[doc(alias = "MTLBlendFactorSourceAlpha")]
    pub const SourceAlpha: Self = Self(4);
    #[doc(alias = "MTLBlendFactorOneMinusSourceAlpha")]
    pub const OneMinusSourceAlpha: Self = Self(5);
    #[doc(alias = "MTLBlendFactorDestinationColor")]
    pub const DestinationColor: Self = Self(6);
    #[doc(alias = "MTLBlendFactorOneMinusDestinationColor")]
    pub const OneMinusDestinationColor: Self = Self(7);
    #[doc(alias = "MTLBlendFactorDestinationAlpha")]
    pub const DestinationAlpha: Self = Self(8);
    #[doc(alias = "MTLBlendFactorOneMinusDestinationAlpha")]
    pub const OneMinusDestinationAlpha: Self = Self(9);
    #[doc(alias = "MTLBlendFactorSourceAlphaSaturated")]
    pub const SourceAlphaSaturated: Self = Self(10);
    #[doc(alias = "MTLBlendFactorBlendColor")]
    pub const BlendColor: Self = Self(11);
    #[doc(alias = "MTLBlendFactorOneMinusBlendColor")]
    pub const OneMinusBlendColor: Self = Self(12);
    #[doc(alias = "MTLBlendFactorBlendAlpha")]
    pub const BlendAlpha: Self = Self(13);
    #[doc(alias = "MTLBlendFactorOneMinusBlendAlpha")]
    pub const OneMinusBlendAlpha: Self = Self(14);
    #[doc(alias = "MTLBlendFactorSource1Color")]
    pub const Source1Color: Self = Self(15);
    #[doc(alias = "MTLBlendFactorOneMinusSource1Color")]
    pub const OneMinusSource1Color: Self = Self(16);
    #[doc(alias = "MTLBlendFactorSource1Alpha")]
    pub const Source1Alpha: Self = Self(17);
    #[doc(alias = "MTLBlendFactorOneMinusSource1Alpha")]
    pub const OneMinusSource1Alpha: Self = Self(18);
}

unsafe impl Encode for MTLBlendFactor {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for MTLBlendFactor {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTLBlendOperation(pub NSUInteger);
impl MTLBlendOperation {
    #[doc(alias = "MTLBlendOperationAdd")]
    pub const Add: Self = Self(0);
    #[doc(alias = "MTLBlendOperationSubtract")]
    pub const Subtract: Self = Self(1);
    #[doc(alias = "MTLBlendOperationReverseSubtract")]
    pub const ReverseSubtract: Self = Self(2);
    #[doc(alias = "MTLBlendOperationMin")]
    pub const Min: Self = Self(3);
    #[doc(alias = "MTLBlendOperationMax")]
    pub const Max: Self = Self(4);
}

unsafe impl Encode for MTLBlendOperation {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for MTLBlendOperation {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTLColorWriteMask(pub NSUInteger);
bitflags::bitflags! {
    impl MTLColorWriteMask: NSUInteger {
        #[doc(alias = "MTLColorWriteMaskNone")]
        const None = 0;
        #[doc(alias = "MTLColorWriteMaskRed")]
        const Red = 0x1<<3;
        #[doc(alias = "MTLColorWriteMaskGreen")]
        const Green = 0x1<<2;
        #[doc(alias = "MTLColorWriteMaskBlue")]
        const Blue = 0x1<<1;
        #[doc(alias = "MTLColorWriteMaskAlpha")]
        const Alpha = 0x1<<0;
        #[doc(alias = "MTLColorWriteMaskAll")]
        const All = 0xf;
    }
}

unsafe impl Encode for MTLColorWriteMask {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for MTLColorWriteMask {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTLPrimitiveTopologyClass(pub NSUInteger);
impl MTLPrimitiveTopologyClass {
    #[doc(alias = "MTLPrimitiveTopologyClassUnspecified")]
    pub const Unspecified: Self = Self(0);
    #[doc(alias = "MTLPrimitiveTopologyClassPoint")]
    pub const Point: Self = Self(1);
    #[doc(alias = "MTLPrimitiveTopologyClassLine")]
    pub const Line: Self = Self(2);
    #[doc(alias = "MTLPrimitiveTopologyClassTriangle")]
    pub const Triangle: Self = Self(3);
}

unsafe impl Encode for MTLPrimitiveTopologyClass {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for MTLPrimitiveTopologyClass {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTLTessellationPartitionMode(pub NSUInteger);
impl MTLTessellationPartitionMode {
    #[doc(alias = "MTLTessellationPartitionModePow2")]
    pub const Pow2: Self = Self(0);
    #[doc(alias = "MTLTessellationPartitionModeInteger")]
    pub const Integer: Self = Self(1);
    #[doc(alias = "MTLTessellationPartitionModeFractionalOdd")]
    pub const FractionalOdd: Self = Self(2);
    #[doc(alias = "MTLTessellationPartitionModeFractionalEven")]
    pub const FractionalEven: Self = Self(3);
}

unsafe impl Encode for MTLTessellationPartitionMode {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for MTLTessellationPartitionMode {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTLTessellationFactorStepFunction(pub NSUInteger);
impl MTLTessellationFactorStepFunction {
    #[doc(alias = "MTLTessellationFactorStepFunctionConstant")]
    pub const Constant: Self = Self(0);
    #[doc(alias = "MTLTessellationFactorStepFunctionPerPatch")]
    pub const PerPatch: Self = Self(1);
    #[doc(alias = "MTLTessellationFactorStepFunctionPerInstance")]
    pub const PerInstance: Self = Self(2);
    #[doc(alias = "MTLTessellationFactorStepFunctionPerPatchAndPerInstance")]
    pub const PerPatchAndPerInstance: Self = Self(3);
}

unsafe impl Encode for MTLTessellationFactorStepFunction {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for MTLTessellationFactorStepFunction {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTLTessellationFactorFormat(pub NSUInteger);
impl MTLTessellationFactorFormat {
    #[doc(alias = "MTLTessellationFactorFormatHalf")]
    pub const Half: Self = Self(0);
}

unsafe impl Encode for MTLTessellationFactorFormat {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for MTLTessellationFactorFormat {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTLTessellationControlPointIndexType(pub NSUInteger);
impl MTLTessellationControlPointIndexType {
    #[doc(alias = "MTLTessellationControlPointIndexTypeNone")]
    pub const None: Self = Self(0);
    #[doc(alias = "MTLTessellationControlPointIndexTypeUInt16")]
    pub const UInt16: Self = Self(1);
    #[doc(alias = "MTLTessellationControlPointIndexTypeUInt32")]
    pub const UInt32: Self = Self(2);
}

unsafe impl Encode for MTLTessellationControlPointIndexType {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for MTLTessellationControlPointIndexType {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MTLRenderPipelineColorAttachmentDescriptor;

    unsafe impl ClassType for MTLRenderPipelineColorAttachmentDescriptor {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSCopying for MTLRenderPipelineColorAttachmentDescriptor {}

unsafe impl NSObjectProtocol for MTLRenderPipelineColorAttachmentDescriptor {}

extern_methods!(
    unsafe impl MTLRenderPipelineColorAttachmentDescriptor {
        #[cfg(feature = "MTLPixelFormat")]
        #[method(pixelFormat)]
        pub fn pixelFormat(&self) -> MTLPixelFormat;

        #[cfg(feature = "MTLPixelFormat")]
        #[method(setPixelFormat:)]
        pub fn setPixelFormat(&self, pixel_format: MTLPixelFormat);

        #[method(isBlendingEnabled)]
        pub fn isBlendingEnabled(&self) -> bool;

        #[method(setBlendingEnabled:)]
        pub fn setBlendingEnabled(&self, blending_enabled: bool);

        #[method(sourceRGBBlendFactor)]
        pub fn sourceRGBBlendFactor(&self) -> MTLBlendFactor;

        #[method(setSourceRGBBlendFactor:)]
        pub fn setSourceRGBBlendFactor(&self, source_rgb_blend_factor: MTLBlendFactor);

        #[method(destinationRGBBlendFactor)]
        pub fn destinationRGBBlendFactor(&self) -> MTLBlendFactor;

        #[method(setDestinationRGBBlendFactor:)]
        pub fn setDestinationRGBBlendFactor(&self, destination_rgb_blend_factor: MTLBlendFactor);

        #[method(rgbBlendOperation)]
        pub fn rgbBlendOperation(&self) -> MTLBlendOperation;

        #[method(setRgbBlendOperation:)]
        pub fn setRgbBlendOperation(&self, rgb_blend_operation: MTLBlendOperation);

        #[method(sourceAlphaBlendFactor)]
        pub fn sourceAlphaBlendFactor(&self) -> MTLBlendFactor;

        #[method(setSourceAlphaBlendFactor:)]
        pub fn setSourceAlphaBlendFactor(&self, source_alpha_blend_factor: MTLBlendFactor);

        #[method(destinationAlphaBlendFactor)]
        pub fn destinationAlphaBlendFactor(&self) -> MTLBlendFactor;

        #[method(setDestinationAlphaBlendFactor:)]
        pub fn setDestinationAlphaBlendFactor(
            &self,
            destination_alpha_blend_factor: MTLBlendFactor,
        );

        #[method(alphaBlendOperation)]
        pub fn alphaBlendOperation(&self) -> MTLBlendOperation;

        #[method(setAlphaBlendOperation:)]
        pub fn setAlphaBlendOperation(&self, alpha_blend_operation: MTLBlendOperation);

        #[method(writeMask)]
        pub fn writeMask(&self) -> MTLColorWriteMask;

        #[method(setWriteMask:)]
        pub fn setWriteMask(&self, write_mask: MTLColorWriteMask);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl MTLRenderPipelineColorAttachmentDescriptor {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MTLRenderPipelineReflection;

    unsafe impl ClassType for MTLRenderPipelineReflection {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for MTLRenderPipelineReflection {}

extern_methods!(
    unsafe impl MTLRenderPipelineReflection {
        #[cfg(feature = "MTLArgument")]
        #[method_id(@__retain_semantics Other vertexBindings)]
        pub unsafe fn vertexBindings(&self) -> Retained<NSArray<ProtocolObject<dyn MTLBinding>>>;

        #[cfg(feature = "MTLArgument")]
        #[method_id(@__retain_semantics Other fragmentBindings)]
        pub unsafe fn fragmentBindings(&self) -> Retained<NSArray<ProtocolObject<dyn MTLBinding>>>;

        #[cfg(feature = "MTLArgument")]
        #[method_id(@__retain_semantics Other tileBindings)]
        pub unsafe fn tileBindings(&self) -> Retained<NSArray<ProtocolObject<dyn MTLBinding>>>;

        #[cfg(feature = "MTLArgument")]
        #[method_id(@__retain_semantics Other objectBindings)]
        pub unsafe fn objectBindings(&self) -> Retained<NSArray<ProtocolObject<dyn MTLBinding>>>;

        #[cfg(feature = "MTLArgument")]
        #[method_id(@__retain_semantics Other meshBindings)]
        pub unsafe fn meshBindings(&self) -> Retained<NSArray<ProtocolObject<dyn MTLBinding>>>;

        #[cfg(feature = "MTLArgument")]
        #[deprecated]
        #[method_id(@__retain_semantics Other vertexArguments)]
        pub fn vertexArguments(&self) -> Option<Retained<NSArray<MTLArgument>>>;

        #[cfg(feature = "MTLArgument")]
        #[deprecated]
        #[method_id(@__retain_semantics Other fragmentArguments)]
        pub fn fragmentArguments(&self) -> Option<Retained<NSArray<MTLArgument>>>;

        #[cfg(feature = "MTLArgument")]
        #[deprecated]
        #[method_id(@__retain_semantics Other tileArguments)]
        pub fn tileArguments(&self) -> Option<Retained<NSArray<MTLArgument>>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl MTLRenderPipelineReflection {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MTLRenderPipelineDescriptor;

    unsafe impl ClassType for MTLRenderPipelineDescriptor {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSCopying for MTLRenderPipelineDescriptor {}

unsafe impl NSObjectProtocol for MTLRenderPipelineDescriptor {}

extern_methods!(
    unsafe impl MTLRenderPipelineDescriptor {
        #[method_id(@__retain_semantics Other label)]
        pub fn label(&self) -> Option<Retained<NSString>>;

        #[method(setLabel:)]
        pub fn setLabel(&self, label: Option<&NSString>);

        #[cfg(feature = "MTLLibrary")]
        #[method_id(@__retain_semantics Other vertexFunction)]
        pub fn vertexFunction(&self) -> Option<Retained<ProtocolObject<dyn MTLFunction>>>;

        #[cfg(feature = "MTLLibrary")]
        #[method(setVertexFunction:)]
        pub fn setVertexFunction(&self, vertex_function: Option<&ProtocolObject<dyn MTLFunction>>);

        #[cfg(feature = "MTLLibrary")]
        #[method_id(@__retain_semantics Other fragmentFunction)]
        pub fn fragmentFunction(&self) -> Option<Retained<ProtocolObject<dyn MTLFunction>>>;

        #[cfg(feature = "MTLLibrary")]
        #[method(setFragmentFunction:)]
        pub fn setFragmentFunction(
            &self,
            fragment_function: Option<&ProtocolObject<dyn MTLFunction>>,
        );

        #[cfg(feature = "MTLVertexDescriptor")]
        #[method_id(@__retain_semantics Other vertexDescriptor)]
        pub fn vertexDescriptor(&self) -> Option<Retained<MTLVertexDescriptor>>;

        #[cfg(feature = "MTLVertexDescriptor")]
        #[method(setVertexDescriptor:)]
        pub fn setVertexDescriptor(&self, vertex_descriptor: Option<&MTLVertexDescriptor>);

        #[deprecated]
        #[method(sampleCount)]
        pub fn sampleCount(&self) -> NSUInteger;

        #[deprecated]
        #[method(setSampleCount:)]
        pub fn setSampleCount(&self, sample_count: NSUInteger);

        #[method(rasterSampleCount)]
        pub fn rasterSampleCount(&self) -> NSUInteger;

        #[method(setRasterSampleCount:)]
        pub fn setRasterSampleCount(&self, raster_sample_count: NSUInteger);

        #[method(isAlphaToCoverageEnabled)]
        pub fn isAlphaToCoverageEnabled(&self) -> bool;

        #[method(setAlphaToCoverageEnabled:)]
        pub fn setAlphaToCoverageEnabled(&self, alpha_to_coverage_enabled: bool);

        #[method(isAlphaToOneEnabled)]
        pub fn isAlphaToOneEnabled(&self) -> bool;

        #[method(setAlphaToOneEnabled:)]
        pub fn setAlphaToOneEnabled(&self, alpha_to_one_enabled: bool);

        #[method(isRasterizationEnabled)]
        pub fn isRasterizationEnabled(&self) -> bool;

        #[method(setRasterizationEnabled:)]
        pub fn setRasterizationEnabled(&self, rasterization_enabled: bool);

        #[method(maxVertexAmplificationCount)]
        pub fn maxVertexAmplificationCount(&self) -> NSUInteger;

        #[method(setMaxVertexAmplificationCount:)]
        pub unsafe fn setMaxVertexAmplificationCount(
            &self,
            max_vertex_amplification_count: NSUInteger,
        );

        #[method_id(@__retain_semantics Other colorAttachments)]
        pub fn colorAttachments(&self)
            -> Retained<MTLRenderPipelineColorAttachmentDescriptorArray>;

        #[cfg(feature = "MTLPixelFormat")]
        #[method(depthAttachmentPixelFormat)]
        pub fn depthAttachmentPixelFormat(&self) -> MTLPixelFormat;

        #[cfg(feature = "MTLPixelFormat")]
        #[method(setDepthAttachmentPixelFormat:)]
        pub fn setDepthAttachmentPixelFormat(&self, depth_attachment_pixel_format: MTLPixelFormat);

        #[cfg(feature = "MTLPixelFormat")]
        #[method(stencilAttachmentPixelFormat)]
        pub fn stencilAttachmentPixelFormat(&self) -> MTLPixelFormat;

        #[cfg(feature = "MTLPixelFormat")]
        #[method(setStencilAttachmentPixelFormat:)]
        pub fn setStencilAttachmentPixelFormat(
            &self,
            stencil_attachment_pixel_format: MTLPixelFormat,
        );

        #[method(inputPrimitiveTopology)]
        pub fn inputPrimitiveTopology(&self) -> MTLPrimitiveTopologyClass;

        #[method(setInputPrimitiveTopology:)]
        pub unsafe fn setInputPrimitiveTopology(
            &self,
            input_primitive_topology: MTLPrimitiveTopologyClass,
        );

        #[method(tessellationPartitionMode)]
        pub fn tessellationPartitionMode(&self) -> MTLTessellationPartitionMode;

        #[method(setTessellationPartitionMode:)]
        pub unsafe fn setTessellationPartitionMode(
            &self,
            tessellation_partition_mode: MTLTessellationPartitionMode,
        );

        #[method(maxTessellationFactor)]
        pub fn maxTessellationFactor(&self) -> NSUInteger;

        #[method(setMaxTessellationFactor:)]
        pub unsafe fn setMaxTessellationFactor(&self, max_tessellation_factor: NSUInteger);

        #[method(isTessellationFactorScaleEnabled)]
        pub fn isTessellationFactorScaleEnabled(&self) -> bool;

        #[method(setTessellationFactorScaleEnabled:)]
        pub fn setTessellationFactorScaleEnabled(&self, tessellation_factor_scale_enabled: bool);

        #[method(tessellationFactorFormat)]
        pub fn tessellationFactorFormat(&self) -> MTLTessellationFactorFormat;

        #[method(setTessellationFactorFormat:)]
        pub fn setTessellationFactorFormat(
            &self,
            tessellation_factor_format: MTLTessellationFactorFormat,
        );

        #[method(tessellationControlPointIndexType)]
        pub fn tessellationControlPointIndexType(&self) -> MTLTessellationControlPointIndexType;

        #[method(setTessellationControlPointIndexType:)]
        pub unsafe fn setTessellationControlPointIndexType(
            &self,
            tessellation_control_point_index_type: MTLTessellationControlPointIndexType,
        );

        #[method(tessellationFactorStepFunction)]
        pub fn tessellationFactorStepFunction(&self) -> MTLTessellationFactorStepFunction;

        #[method(setTessellationFactorStepFunction:)]
        pub fn setTessellationFactorStepFunction(
            &self,
            tessellation_factor_step_function: MTLTessellationFactorStepFunction,
        );

        #[cfg(feature = "MTLRenderCommandEncoder")]
        #[method(tessellationOutputWindingOrder)]
        pub fn tessellationOutputWindingOrder(&self) -> MTLWinding;

        #[cfg(feature = "MTLRenderCommandEncoder")]
        #[method(setTessellationOutputWindingOrder:)]
        pub fn setTessellationOutputWindingOrder(
            &self,
            tessellation_output_winding_order: MTLWinding,
        );

        #[cfg(feature = "MTLPipeline")]
        #[method_id(@__retain_semantics Other vertexBuffers)]
        pub fn vertexBuffers(&self) -> Retained<MTLPipelineBufferDescriptorArray>;

        #[cfg(feature = "MTLPipeline")]
        #[method_id(@__retain_semantics Other fragmentBuffers)]
        pub fn fragmentBuffers(&self) -> Retained<MTLPipelineBufferDescriptorArray>;

        #[method(supportIndirectCommandBuffers)]
        pub fn supportIndirectCommandBuffers(&self) -> bool;

        #[method(setSupportIndirectCommandBuffers:)]
        pub fn setSupportIndirectCommandBuffers(&self, support_indirect_command_buffers: bool);

        #[cfg(feature = "MTLBinaryArchive")]
        #[method_id(@__retain_semantics Other binaryArchives)]
        pub fn binaryArchives(
            &self,
        ) -> Option<Retained<NSArray<ProtocolObject<dyn MTLBinaryArchive>>>>;

        #[cfg(feature = "MTLBinaryArchive")]
        #[method(setBinaryArchives:)]
        pub fn setBinaryArchives(
            &self,
            binary_archives: Option<&NSArray<ProtocolObject<dyn MTLBinaryArchive>>>,
        );

        #[cfg(feature = "MTLDynamicLibrary")]
        #[method_id(@__retain_semantics Other vertexPreloadedLibraries)]
        pub fn vertexPreloadedLibraries(
            &self,
        ) -> Retained<NSArray<ProtocolObject<dyn MTLDynamicLibrary>>>;

        #[cfg(feature = "MTLDynamicLibrary")]
        #[method(setVertexPreloadedLibraries:)]
        pub fn setVertexPreloadedLibraries(
            &self,
            vertex_preloaded_libraries: &NSArray<ProtocolObject<dyn MTLDynamicLibrary>>,
        );

        #[cfg(feature = "MTLDynamicLibrary")]
        #[method_id(@__retain_semantics Other fragmentPreloadedLibraries)]
        pub fn fragmentPreloadedLibraries(
            &self,
        ) -> Retained<NSArray<ProtocolObject<dyn MTLDynamicLibrary>>>;

        #[cfg(feature = "MTLDynamicLibrary")]
        #[method(setFragmentPreloadedLibraries:)]
        pub fn setFragmentPreloadedLibraries(
            &self,
            fragment_preloaded_libraries: &NSArray<ProtocolObject<dyn MTLDynamicLibrary>>,
        );

        #[cfg(feature = "MTLLinkedFunctions")]
        #[method_id(@__retain_semantics Other vertexLinkedFunctions)]
        pub fn vertexLinkedFunctions(&self) -> Retained<MTLLinkedFunctions>;

        #[cfg(feature = "MTLLinkedFunctions")]
        #[method(setVertexLinkedFunctions:)]
        pub fn setVertexLinkedFunctions(
            &self,
            vertex_linked_functions: Option<&MTLLinkedFunctions>,
        );

        #[cfg(feature = "MTLLinkedFunctions")]
        #[method_id(@__retain_semantics Other fragmentLinkedFunctions)]
        pub fn fragmentLinkedFunctions(&self) -> Retained<MTLLinkedFunctions>;

        #[cfg(feature = "MTLLinkedFunctions")]
        #[method(setFragmentLinkedFunctions:)]
        pub fn setFragmentLinkedFunctions(
            &self,
            fragment_linked_functions: Option<&MTLLinkedFunctions>,
        );

        #[method(supportAddingVertexBinaryFunctions)]
        pub fn supportAddingVertexBinaryFunctions(&self) -> bool;

        #[method(setSupportAddingVertexBinaryFunctions:)]
        pub fn setSupportAddingVertexBinaryFunctions(
            &self,
            support_adding_vertex_binary_functions: bool,
        );

        #[method(supportAddingFragmentBinaryFunctions)]
        pub fn supportAddingFragmentBinaryFunctions(&self) -> bool;

        #[method(setSupportAddingFragmentBinaryFunctions:)]
        pub fn setSupportAddingFragmentBinaryFunctions(
            &self,
            support_adding_fragment_binary_functions: bool,
        );

        #[method(maxVertexCallStackDepth)]
        pub fn maxVertexCallStackDepth(&self) -> NSUInteger;

        #[method(setMaxVertexCallStackDepth:)]
        pub fn setMaxVertexCallStackDepth(&self, max_vertex_call_stack_depth: NSUInteger);

        #[method(maxFragmentCallStackDepth)]
        pub fn maxFragmentCallStackDepth(&self) -> NSUInteger;

        #[method(setMaxFragmentCallStackDepth:)]
        pub fn setMaxFragmentCallStackDepth(&self, max_fragment_call_stack_depth: NSUInteger);

        #[method(reset)]
        pub fn reset(&self);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl MTLRenderPipelineDescriptor {
        #[method_id(@__retain_semantics Init init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub fn new() -> Retained<Self>;
    }
);

impl DefaultRetained for MTLRenderPipelineDescriptor {
    #[inline]
    fn default_id() -> Retained<Self> {
        Self::new()
    }
}

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MTLRenderPipelineFunctionsDescriptor;

    unsafe impl ClassType for MTLRenderPipelineFunctionsDescriptor {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSCopying for MTLRenderPipelineFunctionsDescriptor {}

unsafe impl NSObjectProtocol for MTLRenderPipelineFunctionsDescriptor {}

extern_methods!(
    unsafe impl MTLRenderPipelineFunctionsDescriptor {
        #[cfg(feature = "MTLLibrary")]
        #[method_id(@__retain_semantics Other vertexAdditionalBinaryFunctions)]
        pub unsafe fn vertexAdditionalBinaryFunctions(
            &self,
        ) -> Option<Retained<NSArray<ProtocolObject<dyn MTLFunction>>>>;

        #[cfg(feature = "MTLLibrary")]
        #[method(setVertexAdditionalBinaryFunctions:)]
        pub unsafe fn setVertexAdditionalBinaryFunctions(
            &self,
            vertex_additional_binary_functions: Option<&NSArray<ProtocolObject<dyn MTLFunction>>>,
        );

        #[cfg(feature = "MTLLibrary")]
        #[method_id(@__retain_semantics Other fragmentAdditionalBinaryFunctions)]
        pub unsafe fn fragmentAdditionalBinaryFunctions(
            &self,
        ) -> Option<Retained<NSArray<ProtocolObject<dyn MTLFunction>>>>;

        #[cfg(feature = "MTLLibrary")]
        #[method(setFragmentAdditionalBinaryFunctions:)]
        pub unsafe fn setFragmentAdditionalBinaryFunctions(
            &self,
            fragment_additional_binary_functions: Option<&NSArray<ProtocolObject<dyn MTLFunction>>>,
        );

        #[cfg(feature = "MTLLibrary")]
        #[method_id(@__retain_semantics Other tileAdditionalBinaryFunctions)]
        pub unsafe fn tileAdditionalBinaryFunctions(
            &self,
        ) -> Option<Retained<NSArray<ProtocolObject<dyn MTLFunction>>>>;

        #[cfg(feature = "MTLLibrary")]
        #[method(setTileAdditionalBinaryFunctions:)]
        pub unsafe fn setTileAdditionalBinaryFunctions(
            &self,
            tile_additional_binary_functions: Option<&NSArray<ProtocolObject<dyn MTLFunction>>>,
        );
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl MTLRenderPipelineFunctionsDescriptor {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

extern_protocol!(
    pub unsafe trait MTLRenderPipelineState: NSObjectProtocol + IsRetainable {
        #[method_id(@__retain_semantics Other label)]
        unsafe fn label(&self) -> Option<Retained<NSString>>;

        #[cfg(feature = "MTLDevice")]
        #[method_id(@__retain_semantics Other device)]
        unsafe fn device(&self) -> Retained<ProtocolObject<dyn MTLDevice>>;

        #[method(maxTotalThreadsPerThreadgroup)]
        unsafe fn maxTotalThreadsPerThreadgroup(&self) -> NSUInteger;

        #[method(threadgroupSizeMatchesTileSize)]
        unsafe fn threadgroupSizeMatchesTileSize(&self) -> bool;

        #[method(imageblockSampleLength)]
        unsafe fn imageblockSampleLength(&self) -> NSUInteger;

        #[cfg(feature = "MTLTypes")]
        #[method(imageblockMemoryLengthForDimensions:)]
        unsafe fn imageblockMemoryLengthForDimensions(
            &self,
            imageblock_dimensions: MTLSize,
        ) -> NSUInteger;

        #[method(supportIndirectCommandBuffers)]
        unsafe fn supportIndirectCommandBuffers(&self) -> bool;

        #[method(maxTotalThreadsPerObjectThreadgroup)]
        unsafe fn maxTotalThreadsPerObjectThreadgroup(&self) -> NSUInteger;

        #[method(maxTotalThreadsPerMeshThreadgroup)]
        unsafe fn maxTotalThreadsPerMeshThreadgroup(&self) -> NSUInteger;

        #[method(objectThreadExecutionWidth)]
        unsafe fn objectThreadExecutionWidth(&self) -> NSUInteger;

        #[method(meshThreadExecutionWidth)]
        unsafe fn meshThreadExecutionWidth(&self) -> NSUInteger;

        #[method(maxTotalThreadgroupsPerMeshGrid)]
        unsafe fn maxTotalThreadgroupsPerMeshGrid(&self) -> NSUInteger;

        #[cfg(feature = "MTLTypes")]
        #[method(gpuResourceID)]
        unsafe fn gpuResourceID(&self) -> MTLResourceID;

        #[cfg(all(
            feature = "MTLFunctionHandle",
            feature = "MTLLibrary",
            feature = "MTLRenderCommandEncoder"
        ))]
        #[method_id(@__retain_semantics Other functionHandleWithFunction:stage:)]
        unsafe fn functionHandleWithFunction_stage(
            &self,
            function: &ProtocolObject<dyn MTLFunction>,
            stage: MTLRenderStages,
        ) -> Option<Retained<ProtocolObject<dyn MTLFunctionHandle>>>;

        #[cfg(all(
            feature = "MTLRenderCommandEncoder",
            feature = "MTLResource",
            feature = "MTLVisibleFunctionTable"
        ))]
        #[method_id(@__retain_semantics New newVisibleFunctionTableWithDescriptor:stage:)]
        unsafe fn newVisibleFunctionTableWithDescriptor_stage(
            &self,
            descriptor: &MTLVisibleFunctionTableDescriptor,
            stage: MTLRenderStages,
        ) -> Option<Retained<ProtocolObject<dyn MTLVisibleFunctionTable>>>;

        #[cfg(all(
            feature = "MTLIntersectionFunctionTable",
            feature = "MTLRenderCommandEncoder",
            feature = "MTLResource"
        ))]
        #[method_id(@__retain_semantics New newIntersectionFunctionTableWithDescriptor:stage:)]
        unsafe fn newIntersectionFunctionTableWithDescriptor_stage(
            &self,
            descriptor: &MTLIntersectionFunctionTableDescriptor,
            stage: MTLRenderStages,
        ) -> Option<Retained<ProtocolObject<dyn MTLIntersectionFunctionTable>>>;

        #[method_id(@__retain_semantics New newRenderPipelineStateWithAdditionalBinaryFunctions:error:_)]
        unsafe fn newRenderPipelineStateWithAdditionalBinaryFunctions_error(
            &self,
            additional_binary_functions: &MTLRenderPipelineFunctionsDescriptor,
        ) -> Result<Retained<ProtocolObject<dyn MTLRenderPipelineState>>, Retained<NSError>>;
    }

    unsafe impl ProtocolType for dyn MTLRenderPipelineState {}
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MTLRenderPipelineColorAttachmentDescriptorArray;

    unsafe impl ClassType for MTLRenderPipelineColorAttachmentDescriptorArray {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for MTLRenderPipelineColorAttachmentDescriptorArray {}

extern_methods!(
    unsafe impl MTLRenderPipelineColorAttachmentDescriptorArray {
        #[method_id(@__retain_semantics Other objectAtIndexedSubscript:)]
        pub unsafe fn objectAtIndexedSubscript(
            &self,
            attachment_index: NSUInteger,
        ) -> Retained<MTLRenderPipelineColorAttachmentDescriptor>;

        #[method(setObject:atIndexedSubscript:)]
        pub unsafe fn setObject_atIndexedSubscript(
            &self,
            attachment: Option<&MTLRenderPipelineColorAttachmentDescriptor>,
            attachment_index: NSUInteger,
        );
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl MTLRenderPipelineColorAttachmentDescriptorArray {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MTLTileRenderPipelineColorAttachmentDescriptor;

    unsafe impl ClassType for MTLTileRenderPipelineColorAttachmentDescriptor {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSCopying for MTLTileRenderPipelineColorAttachmentDescriptor {}

unsafe impl NSObjectProtocol for MTLTileRenderPipelineColorAttachmentDescriptor {}

extern_methods!(
    unsafe impl MTLTileRenderPipelineColorAttachmentDescriptor {
        #[cfg(feature = "MTLPixelFormat")]
        #[method(pixelFormat)]
        pub unsafe fn pixelFormat(&self) -> MTLPixelFormat;

        #[cfg(feature = "MTLPixelFormat")]
        #[method(setPixelFormat:)]
        pub unsafe fn setPixelFormat(&self, pixel_format: MTLPixelFormat);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl MTLTileRenderPipelineColorAttachmentDescriptor {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MTLTileRenderPipelineColorAttachmentDescriptorArray;

    unsafe impl ClassType for MTLTileRenderPipelineColorAttachmentDescriptorArray {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for MTLTileRenderPipelineColorAttachmentDescriptorArray {}

extern_methods!(
    unsafe impl MTLTileRenderPipelineColorAttachmentDescriptorArray {
        #[method_id(@__retain_semantics Other objectAtIndexedSubscript:)]
        pub unsafe fn objectAtIndexedSubscript(
            &self,
            attachment_index: NSUInteger,
        ) -> Retained<MTLTileRenderPipelineColorAttachmentDescriptor>;

        #[method(setObject:atIndexedSubscript:)]
        pub unsafe fn setObject_atIndexedSubscript(
            &self,
            attachment: &MTLTileRenderPipelineColorAttachmentDescriptor,
            attachment_index: NSUInteger,
        );
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl MTLTileRenderPipelineColorAttachmentDescriptorArray {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MTLTileRenderPipelineDescriptor;

    unsafe impl ClassType for MTLTileRenderPipelineDescriptor {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSCopying for MTLTileRenderPipelineDescriptor {}

unsafe impl NSObjectProtocol for MTLTileRenderPipelineDescriptor {}

extern_methods!(
    unsafe impl MTLTileRenderPipelineDescriptor {
        #[method_id(@__retain_semantics Other label)]
        pub unsafe fn label(&self) -> Option<Retained<NSString>>;

        #[method(setLabel:)]
        pub unsafe fn setLabel(&self, label: Option<&NSString>);

        #[cfg(feature = "MTLLibrary")]
        #[method_id(@__retain_semantics Other tileFunction)]
        pub unsafe fn tileFunction(&self) -> Retained<ProtocolObject<dyn MTLFunction>>;

        #[cfg(feature = "MTLLibrary")]
        #[method(setTileFunction:)]
        pub unsafe fn setTileFunction(&self, tile_function: &ProtocolObject<dyn MTLFunction>);

        #[method(rasterSampleCount)]
        pub unsafe fn rasterSampleCount(&self) -> NSUInteger;

        #[method(setRasterSampleCount:)]
        pub unsafe fn setRasterSampleCount(&self, raster_sample_count: NSUInteger);

        #[method_id(@__retain_semantics Other colorAttachments)]
        pub unsafe fn colorAttachments(
            &self,
        ) -> Retained<MTLTileRenderPipelineColorAttachmentDescriptorArray>;

        #[method(threadgroupSizeMatchesTileSize)]
        pub unsafe fn threadgroupSizeMatchesTileSize(&self) -> bool;

        #[method(setThreadgroupSizeMatchesTileSize:)]
        pub unsafe fn setThreadgroupSizeMatchesTileSize(
            &self,
            threadgroup_size_matches_tile_size: bool,
        );

        #[cfg(feature = "MTLPipeline")]
        #[method_id(@__retain_semantics Other tileBuffers)]
        pub unsafe fn tileBuffers(&self) -> Retained<MTLPipelineBufferDescriptorArray>;

        #[method(maxTotalThreadsPerThreadgroup)]
        pub unsafe fn maxTotalThreadsPerThreadgroup(&self) -> NSUInteger;

        #[method(setMaxTotalThreadsPerThreadgroup:)]
        pub unsafe fn setMaxTotalThreadsPerThreadgroup(
            &self,
            max_total_threads_per_threadgroup: NSUInteger,
        );

        #[cfg(feature = "MTLBinaryArchive")]
        #[method_id(@__retain_semantics Other binaryArchives)]
        pub unsafe fn binaryArchives(
            &self,
        ) -> Option<Retained<NSArray<ProtocolObject<dyn MTLBinaryArchive>>>>;

        #[cfg(feature = "MTLBinaryArchive")]
        #[method(setBinaryArchives:)]
        pub unsafe fn setBinaryArchives(
            &self,
            binary_archives: Option<&NSArray<ProtocolObject<dyn MTLBinaryArchive>>>,
        );

        #[cfg(feature = "MTLDynamicLibrary")]
        #[method_id(@__retain_semantics Other preloadedLibraries)]
        pub unsafe fn preloadedLibraries(
            &self,
        ) -> Retained<NSArray<ProtocolObject<dyn MTLDynamicLibrary>>>;

        #[cfg(feature = "MTLDynamicLibrary")]
        #[method(setPreloadedLibraries:)]
        pub unsafe fn setPreloadedLibraries(
            &self,
            preloaded_libraries: &NSArray<ProtocolObject<dyn MTLDynamicLibrary>>,
        );

        #[cfg(feature = "MTLLinkedFunctions")]
        #[method_id(@__retain_semantics Other linkedFunctions)]
        pub unsafe fn linkedFunctions(&self) -> Retained<MTLLinkedFunctions>;

        #[cfg(feature = "MTLLinkedFunctions")]
        #[method(setLinkedFunctions:)]
        pub unsafe fn setLinkedFunctions(&self, linked_functions: Option<&MTLLinkedFunctions>);

        #[method(supportAddingBinaryFunctions)]
        pub unsafe fn supportAddingBinaryFunctions(&self) -> bool;

        #[method(setSupportAddingBinaryFunctions:)]
        pub unsafe fn setSupportAddingBinaryFunctions(&self, support_adding_binary_functions: bool);

        #[method(maxCallStackDepth)]
        pub unsafe fn maxCallStackDepth(&self) -> NSUInteger;

        #[method(setMaxCallStackDepth:)]
        pub unsafe fn setMaxCallStackDepth(&self, max_call_stack_depth: NSUInteger);

        #[method(reset)]
        pub unsafe fn reset(&self);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl MTLTileRenderPipelineDescriptor {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MTLMeshRenderPipelineDescriptor;

    unsafe impl ClassType for MTLMeshRenderPipelineDescriptor {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSCopying for MTLMeshRenderPipelineDescriptor {}

unsafe impl NSObjectProtocol for MTLMeshRenderPipelineDescriptor {}

extern_methods!(
    unsafe impl MTLMeshRenderPipelineDescriptor {
        #[method_id(@__retain_semantics Other label)]
        pub unsafe fn label(&self) -> Option<Retained<NSString>>;

        #[method(setLabel:)]
        pub unsafe fn setLabel(&self, label: Option<&NSString>);

        #[cfg(feature = "MTLLibrary")]
        #[method_id(@__retain_semantics Other objectFunction)]
        pub unsafe fn objectFunction(&self) -> Option<Retained<ProtocolObject<dyn MTLFunction>>>;

        #[cfg(feature = "MTLLibrary")]
        #[method(setObjectFunction:)]
        pub unsafe fn setObjectFunction(
            &self,
            object_function: Option<&ProtocolObject<dyn MTLFunction>>,
        );

        #[cfg(feature = "MTLLibrary")]
        #[method_id(@__retain_semantics Other meshFunction)]
        pub unsafe fn meshFunction(&self) -> Option<Retained<ProtocolObject<dyn MTLFunction>>>;

        #[cfg(feature = "MTLLibrary")]
        #[method(setMeshFunction:)]
        pub unsafe fn setMeshFunction(
            &self,
            mesh_function: Option<&ProtocolObject<dyn MTLFunction>>,
        );

        #[cfg(feature = "MTLLibrary")]
        #[method_id(@__retain_semantics Other fragmentFunction)]
        pub unsafe fn fragmentFunction(&self) -> Option<Retained<ProtocolObject<dyn MTLFunction>>>;

        #[cfg(feature = "MTLLibrary")]
        #[method(setFragmentFunction:)]
        pub unsafe fn setFragmentFunction(
            &self,
            fragment_function: Option<&ProtocolObject<dyn MTLFunction>>,
        );

        #[method(maxTotalThreadsPerObjectThreadgroup)]
        pub unsafe fn maxTotalThreadsPerObjectThreadgroup(&self) -> NSUInteger;

        #[method(setMaxTotalThreadsPerObjectThreadgroup:)]
        pub unsafe fn setMaxTotalThreadsPerObjectThreadgroup(
            &self,
            max_total_threads_per_object_threadgroup: NSUInteger,
        );

        #[method(maxTotalThreadsPerMeshThreadgroup)]
        pub unsafe fn maxTotalThreadsPerMeshThreadgroup(&self) -> NSUInteger;

        #[method(setMaxTotalThreadsPerMeshThreadgroup:)]
        pub unsafe fn setMaxTotalThreadsPerMeshThreadgroup(
            &self,
            max_total_threads_per_mesh_threadgroup: NSUInteger,
        );

        #[method(objectThreadgroupSizeIsMultipleOfThreadExecutionWidth)]
        pub unsafe fn objectThreadgroupSizeIsMultipleOfThreadExecutionWidth(&self) -> bool;

        #[method(setObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth:)]
        pub unsafe fn setObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth(
            &self,
            object_threadgroup_size_is_multiple_of_thread_execution_width: bool,
        );

        #[method(meshThreadgroupSizeIsMultipleOfThreadExecutionWidth)]
        pub unsafe fn meshThreadgroupSizeIsMultipleOfThreadExecutionWidth(&self) -> bool;

        #[method(setMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth:)]
        pub unsafe fn setMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth(
            &self,
            mesh_threadgroup_size_is_multiple_of_thread_execution_width: bool,
        );

        #[method(payloadMemoryLength)]
        pub unsafe fn payloadMemoryLength(&self) -> NSUInteger;

        #[method(setPayloadMemoryLength:)]
        pub unsafe fn setPayloadMemoryLength(&self, payload_memory_length: NSUInteger);

        #[method(maxTotalThreadgroupsPerMeshGrid)]
        pub unsafe fn maxTotalThreadgroupsPerMeshGrid(&self) -> NSUInteger;

        #[method(setMaxTotalThreadgroupsPerMeshGrid:)]
        pub unsafe fn setMaxTotalThreadgroupsPerMeshGrid(
            &self,
            max_total_threadgroups_per_mesh_grid: NSUInteger,
        );

        #[cfg(feature = "MTLPipeline")]
        #[method_id(@__retain_semantics Other objectBuffers)]
        pub unsafe fn objectBuffers(&self) -> Retained<MTLPipelineBufferDescriptorArray>;

        #[cfg(feature = "MTLPipeline")]
        #[method_id(@__retain_semantics Other meshBuffers)]
        pub unsafe fn meshBuffers(&self) -> Retained<MTLPipelineBufferDescriptorArray>;

        #[cfg(feature = "MTLPipeline")]
        #[method_id(@__retain_semantics Other fragmentBuffers)]
        pub unsafe fn fragmentBuffers(&self) -> Retained<MTLPipelineBufferDescriptorArray>;

        #[method(rasterSampleCount)]
        pub unsafe fn rasterSampleCount(&self) -> NSUInteger;

        #[method(setRasterSampleCount:)]
        pub unsafe fn setRasterSampleCount(&self, raster_sample_count: NSUInteger);

        #[method(isAlphaToCoverageEnabled)]
        pub unsafe fn isAlphaToCoverageEnabled(&self) -> bool;

        #[method(setAlphaToCoverageEnabled:)]
        pub unsafe fn setAlphaToCoverageEnabled(&self, alpha_to_coverage_enabled: bool);

        #[method(isAlphaToOneEnabled)]
        pub unsafe fn isAlphaToOneEnabled(&self) -> bool;

        #[method(setAlphaToOneEnabled:)]
        pub unsafe fn setAlphaToOneEnabled(&self, alpha_to_one_enabled: bool);

        #[method(isRasterizationEnabled)]
        pub unsafe fn isRasterizationEnabled(&self) -> bool;

        #[method(setRasterizationEnabled:)]
        pub unsafe fn setRasterizationEnabled(&self, rasterization_enabled: bool);

        #[method(maxVertexAmplificationCount)]
        pub unsafe fn maxVertexAmplificationCount(&self) -> NSUInteger;

        #[method(setMaxVertexAmplificationCount:)]
        pub unsafe fn setMaxVertexAmplificationCount(
            &self,
            max_vertex_amplification_count: NSUInteger,
        );

        #[method_id(@__retain_semantics Other colorAttachments)]
        pub unsafe fn colorAttachments(
            &self,
        ) -> Retained<MTLRenderPipelineColorAttachmentDescriptorArray>;

        #[cfg(feature = "MTLPixelFormat")]
        #[method(depthAttachmentPixelFormat)]
        pub unsafe fn depthAttachmentPixelFormat(&self) -> MTLPixelFormat;

        #[cfg(feature = "MTLPixelFormat")]
        #[method(setDepthAttachmentPixelFormat:)]
        pub unsafe fn setDepthAttachmentPixelFormat(
            &self,
            depth_attachment_pixel_format: MTLPixelFormat,
        );

        #[cfg(feature = "MTLPixelFormat")]
        #[method(stencilAttachmentPixelFormat)]
        pub unsafe fn stencilAttachmentPixelFormat(&self) -> MTLPixelFormat;

        #[cfg(feature = "MTLPixelFormat")]
        #[method(setStencilAttachmentPixelFormat:)]
        pub unsafe fn setStencilAttachmentPixelFormat(
            &self,
            stencil_attachment_pixel_format: MTLPixelFormat,
        );

        #[method(supportIndirectCommandBuffers)]
        pub unsafe fn supportIndirectCommandBuffers(&self) -> bool;

        #[method(setSupportIndirectCommandBuffers:)]
        pub unsafe fn setSupportIndirectCommandBuffers(
            &self,
            support_indirect_command_buffers: bool,
        );

        #[cfg(feature = "MTLLinkedFunctions")]
        #[method_id(@__retain_semantics Other objectLinkedFunctions)]
        pub unsafe fn objectLinkedFunctions(&self) -> Retained<MTLLinkedFunctions>;

        #[cfg(feature = "MTLLinkedFunctions")]
        #[method(setObjectLinkedFunctions:)]
        pub unsafe fn setObjectLinkedFunctions(
            &self,
            object_linked_functions: Option<&MTLLinkedFunctions>,
        );

        #[cfg(feature = "MTLLinkedFunctions")]
        #[method_id(@__retain_semantics Other meshLinkedFunctions)]
        pub unsafe fn meshLinkedFunctions(&self) -> Retained<MTLLinkedFunctions>;

        #[cfg(feature = "MTLLinkedFunctions")]
        #[method(setMeshLinkedFunctions:)]
        pub unsafe fn setMeshLinkedFunctions(
            &self,
            mesh_linked_functions: Option<&MTLLinkedFunctions>,
        );

        #[cfg(feature = "MTLLinkedFunctions")]
        #[method_id(@__retain_semantics Other fragmentLinkedFunctions)]
        pub unsafe fn fragmentLinkedFunctions(&self) -> Retained<MTLLinkedFunctions>;

        #[cfg(feature = "MTLLinkedFunctions")]
        #[method(setFragmentLinkedFunctions:)]
        pub unsafe fn setFragmentLinkedFunctions(
            &self,
            fragment_linked_functions: Option<&MTLLinkedFunctions>,
        );

        #[method(reset)]
        pub unsafe fn reset(&self);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl MTLMeshRenderPipelineDescriptor {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);
