//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT

use objc2::rc::{Allocated, Retained};
use objc2::{extern_class, extern_conformance, extern_methods};
use objc2_foundation::{CopyingHelper, NSCopying, NSObject, NSObjectProtocol};

use crate::*;

extern_class!(
    /// Groups together properties you use to create a mesh render pipeline state object.
    ///
    /// Compared to ``MTLMeshRenderPipelineDescriptor``, this interface doesn't offer a mechanism to hint to Metal mutability
    /// of object, mesh, or fragment buffers. Additionally, when you use this descriptor, you don't specify binary archives.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtl4meshrenderpipelinedescriptor?language=objc)
    #[unsafe(super(MTL4PipelineDescriptor, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MTL4MeshRenderPipelineDescriptor;
);

extern_conformance!(
    unsafe impl NSCopying for MTL4MeshRenderPipelineDescriptor {}
);

unsafe impl CopyingHelper for MTL4MeshRenderPipelineDescriptor {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for MTL4MeshRenderPipelineDescriptor {}
);

impl MTL4MeshRenderPipelineDescriptor {
    extern_methods!(
        /// Assigns a function descriptor representing the function this pipeline executes for each *object* in the object shader stage.
        #[unsafe(method(objectFunctionDescriptor))]
        #[unsafe(method_family = none)]
        pub fn object_function_descriptor(&self)
        -> Option<Retained<MTL4FunctionDescriptor>>;

        /// Setter for [`objectFunctionDescriptor`][Self::objectFunctionDescriptor].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setObjectFunctionDescriptor:))]
        #[unsafe(method_family = none)]
        pub fn set_object_function_descriptor(
            &self,
            object_function_descriptor: Option<&MTL4FunctionDescriptor>,
        );

        /// Assigns a function descriptor representing the function this pipeline executes for each primitive in the mesh shader stage.
        #[unsafe(method(meshFunctionDescriptor))]
        #[unsafe(method_family = none)]
        pub fn mesh_function_descriptor(&self) -> Option<Retained<MTL4FunctionDescriptor>>;

        /// Setter for [`meshFunctionDescriptor`][Self::meshFunctionDescriptor].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setMeshFunctionDescriptor:))]
        #[unsafe(method_family = none)]
        pub fn set_mesh_function_descriptor(
            &self,
            mesh_function_descriptor: Option<&MTL4FunctionDescriptor>,
        );

        /// Assigns a function descriptor representing the function this pipeline executes for each fragment.
        #[unsafe(method(fragmentFunctionDescriptor))]
        #[unsafe(method_family = none)]
        pub fn fragment_function_descriptor(
            &self,
        ) -> Option<Retained<MTL4FunctionDescriptor>>;

        /// Setter for [`fragmentFunctionDescriptor`][Self::fragmentFunctionDescriptor].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setFragmentFunctionDescriptor:))]
        #[unsafe(method_family = none)]
        pub fn set_fragment_function_descriptor(
            &self,
            fragment_function_descriptor: Option<&MTL4FunctionDescriptor>,
        );

        /// Controls the largest number of threads the pipeline state can execute in a single object shader threadgroup dispatch.
        ///
        /// This number represents the maximum size of the product of the components of parameter `threadsPerObjectThreadgroup`
        /// that Metal can use when drawing with this pipeline in mesh shader dispatch methods, such as
        /// ``MTL4RenderCommandEncoder/drawMeshThreadgroups:threadsPerObjectThreadgroup:threadsPerMeshThreadgroup:``.
        ///
        /// The compiler's optimizer can use the value of this property to generate more efficient code, specifically when
        /// the value doesn't exceed the thread execution width of the underlying GPU.
        ///
        /// The default value of this property is `0`, which indicates that the number you pass to attribute
        /// `[[max_total_threads_per_threadgroup(N)]]` of the pipeline's object function determines the maximum
        /// total threads per threadgroup.
        ///
        /// When you specify both the `[[max_total_threads_per_threadgroup(N)]]` attribute and this property, you are responsible
        /// for making sure these values match.
        ///
        /// Additionally, you are responsible for ensuring this value doesn't exceed the "maximum threads per threadgroup"
        /// device limit documented in the "Metal Feature Set Tables" PDF:
        /// <https
        /// ://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf>.
        #[unsafe(method(maxTotalThreadsPerObjectThreadgroup))]
        #[unsafe(method_family = none)]
        pub fn max_total_threads_per_object_threadgroup(&self) -> usize;

        /// Setter for [`maxTotalThreadsPerObjectThreadgroup`][Self::maxTotalThreadsPerObjectThreadgroup].
        #[unsafe(method(setMaxTotalThreadsPerObjectThreadgroup:))]
        #[unsafe(method_family = none)]
        pub fn set_max_total_threads_per_object_threadgroup(
            &self,
            max_total_threads_per_object_threadgroup: usize,
        );

        /// Controls the largest number of threads the pipeline state can execute in a single mesh shader threadgroup dispatch.
        ///
        /// This number represents the maximum size of the product of the components of parameter `threadsPerMeshThreadgroup`
        /// that Metal can use when drawing with this pipeline in mesh shader dispatch methods, such as
        /// ``MTL4RenderCommandEncoder/drawMeshThreadgroups:threadsPerObjectThreadgroup:threadsPerMeshThreadgroup:``.
        ///
        /// The compiler's optimizer can use the value of this property to generate more efficient code, specifically when
        /// the value doesn't exceed the thread execution width of the underlying GPU.
        ///
        /// The default value of this property is `0`, thish indicates that the Metal Shader Language attribute
        /// `[[max_total_threads_per_threadgroup]]` you attache to the pipeline's mesh shader function determines
        /// the value of this property.
        ///
        /// When you specify both the `[[max_total_threads_per_threadgroup(N)]]` attribute and this property, you are responsible
        /// for making sure these values match.
        ///
        /// Additionally, you are responsible for ensuring this value doesn't exceed the "maximum threads per threadgroup"
        /// device limit documented in the "Metal Feature Set Tables" PDF:
        /// <https
        /// ://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf>.
        #[unsafe(method(maxTotalThreadsPerMeshThreadgroup))]
        #[unsafe(method_family = none)]
        pub fn max_total_threads_per_mesh_threadgroup(&self) -> usize;

        /// Setter for [`maxTotalThreadsPerMeshThreadgroup`][Self::maxTotalThreadsPerMeshThreadgroup].
        #[unsafe(method(setMaxTotalThreadsPerMeshThreadgroup:))]
        #[unsafe(method_family = none)]
        pub fn set_max_total_threads_per_mesh_threadgroup(
            &self,
            max_total_threads_per_mesh_threadgroup: usize,
        );

        /// Controls the required number of object threads-per-threadgroup when drawing with a mesh shader pipeline you create
        /// from this descriptor.
        ///
        /// This argument is optional, unless this pipeline uses `CooperativeTensors`, in which case you are responsible for providing it.
        ///
        /// When this value is set to non-zero, you are responsible for ensuring the parameter `threadsPerObjectThreadgroup`
        /// in any mesh dispatch draw calls that use this mesh render pipeline, such as
        /// ``MTL4RenderCommandEncoder/drawMeshThreadgroups:threadsPerObjectThreadgroup:threadsPerMeshThreadgroup:``,
        /// match it.
        ///
        /// Setting this value to a size of 0 in every dimension disables this property.
        #[unsafe(method(requiredThreadsPerObjectThreadgroup))]
        #[unsafe(method_family = none)]
        pub fn required_threads_per_object_threadgroup(&self) -> MTLSize;

        /// Setter for [`requiredThreadsPerObjectThreadgroup`][Self::requiredThreadsPerObjectThreadgroup].
        #[unsafe(method(setRequiredThreadsPerObjectThreadgroup:))]
        #[unsafe(method_family = none)]
        pub fn set_required_threads_per_object_threadgroup(
            &self,
            required_threads_per_object_threadgroup: MTLSize,
        );

        /// Controls the required number of mesh threads-per-threadgroup when drawing with a mesh shader pipeline you create
        /// from this descriptor.
        ///
        /// This argument is optional, unless this pipeline uses `CooperativeTensors`, in which case you are responsible for providing it.
        ///
        /// When this value is set to non-zero, you are responsible for ensuring the parameter `threadsPerMeshThreadgroup`
        /// in any mesh dispatch draw calls that use this mesh render pipeline, such as
        /// ``MTL4RenderCommandEncoder/drawMeshThreadgroups:threadsPerObjectThreadgroup:threadsPerMeshThreadgroup:``,
        /// match it.
        ///
        /// Setting this value to a size of 0 in every dimension disables this property.
        #[unsafe(method(requiredThreadsPerMeshThreadgroup))]
        #[unsafe(method_family = none)]
        pub fn required_threads_per_mesh_threadgroup(&self) -> MTLSize;

        /// Setter for [`requiredThreadsPerMeshThreadgroup`][Self::requiredThreadsPerMeshThreadgroup].
        #[unsafe(method(setRequiredThreadsPerMeshThreadgroup:))]
        #[unsafe(method_family = none)]
        pub fn set_required_threads_per_mesh_threadgroup(
            &self,
            required_threads_per_mesh_threadgroup: MTLSize,
        );

        /// Provides a guarantee to Metal regarding the number of threadgroup threads for the object stage of a pipeline you
        /// create from this descriptor.
        ///
        /// If you set this property to
        /// <doc
        /// ://com.apple.documentation/documentation/swift/true>, you state to Metal that when
        /// you use a mesh render pipeline you create from this descriptor, the number of threadgroup threads you dispatch for
        /// the object stage is a multiple of its ``MTLRenderPipelineState/objectThreadExecutionWidth``. The compiler's optimizer can use this guarantee to generate
        /// more efficient code.
        ///
        /// This property's default value is
        /// <doc
        /// ://com.apple.documentation/documentation/swift/false>.
        #[unsafe(method(objectThreadgroupSizeIsMultipleOfThreadExecutionWidth))]
        #[unsafe(method_family = none)]
        pub fn object_threadgroup_size_is_multiple_of_thread_execution_width(&self) -> bool;

        /// Setter for [`objectThreadgroupSizeIsMultipleOfThreadExecutionWidth`][Self::objectThreadgroupSizeIsMultipleOfThreadExecutionWidth].
        #[unsafe(method(setObjectThreadgroupSizeIsMultipleOfThreadExecutionWidth:))]
        #[unsafe(method_family = none)]
        pub fn set_object_threadgroup_size_is_multiple_of_thread_execution_width(
            &self,
            object_threadgroup_size_is_multiple_of_thread_execution_width: bool,
        );

        /// Provides a guarantee to Metal regarding the number of threadgroup threads for the mesh stage of a pipeline you
        /// create from this descriptor.
        ///
        /// If you set this property to
        /// <doc
        /// ://com.apple.documentation/documentation/swift/true>, you state to Metal that when
        /// you use a mesh render pipeline you create from this descriptor, the number of threadgroup threads you dispatch for
        /// the mesh stage is a multiple of its ``MTLRenderPipelineState/meshThreadExecutionWidth``. The compiler's optimizer
        /// can use this guarantee to generate more efficient code.
        ///
        /// This property's default value is
        /// <doc
        /// ://com.apple.documentation/documentation/swift/false>.
        #[unsafe(method(meshThreadgroupSizeIsMultipleOfThreadExecutionWidth))]
        #[unsafe(method_family = none)]
        pub fn mesh_threadgroup_size_is_multiple_of_thread_execution_width(&self) -> bool;

        /// Setter for [`meshThreadgroupSizeIsMultipleOfThreadExecutionWidth`][Self::meshThreadgroupSizeIsMultipleOfThreadExecutionWidth].
        #[unsafe(method(setMeshThreadgroupSizeIsMultipleOfThreadExecutionWidth:))]
        #[unsafe(method_family = none)]
        pub fn set_mesh_threadgroup_size_is_multiple_of_thread_execution_width(
            &self,
            mesh_threadgroup_size_is_multiple_of_thread_execution_width: bool,
        );

        /// Reserves storage for the object-to-mesh stage payload.
        ///
        /// This property determines the size, in bytes, of the buffer you indicate via the Metal Shading Language `[[payload]]`
        /// attribute in the object and mesh shader functions of the mesh render pipeline.
        ///
        /// If this value is `0`, Metal derives the size from the (dereferenced) type you declare for the payload in the object
        /// shader function. If the type is a pointer, Metal reserves space for a single element.
        ///
        /// The default value is `0`.
        #[unsafe(method(payloadMemoryLength))]
        #[unsafe(method_family = none)]
        pub fn payload_memory_length(&self) -> usize;

        /// Setter for [`payloadMemoryLength`][Self::payloadMemoryLength].
        #[unsafe(method(setPayloadMemoryLength:))]
        #[unsafe(method_family = none)]
        pub fn set_payload_memory_length(&self, payload_memory_length: usize);

        /// Controls the largest number of threads the pipeline state can execute when the object stage of a mesh
        /// render pipeline you create from this descriptor dispatches its mesh stage.
        ///
        /// This number represents the maximum size of the product of the components of the parameter you pass to Metal
        /// Shading Language's built-in function `mesh_grid_properties::set_threadgroups_per_grid`.
        ///
        /// The default value of this property is `0`, which indicates that the Metal Shading Language attribute
        /// `[[max_total_threadgroups_per_mesh_grid(N)]]` you attach to the pipeline's mesh shader function determines
        /// the value of this property.
        ///
        /// When you specify both the `[[max_total_threadgroups_per_mesh_grid(N)]]` attribute and this property, you are
        /// responsible for making sure these values match.
        ///
        /// Additionally, you are responsible for ensuring this value doesn't exceed the "maximum threads per mesh grid"
        /// device limit documented in the "Metal Feature Set Tables" PDF:
        /// <https
        /// ://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf>.
        #[unsafe(method(maxTotalThreadgroupsPerMeshGrid))]
        #[unsafe(method_family = none)]
        pub fn max_total_threadgroups_per_mesh_grid(&self) -> usize;

        /// Setter for [`maxTotalThreadgroupsPerMeshGrid`][Self::maxTotalThreadgroupsPerMeshGrid].
        #[unsafe(method(setMaxTotalThreadgroupsPerMeshGrid:))]
        #[unsafe(method_family = none)]
        pub fn set_max_total_threadgroups_per_mesh_grid(
            &self,
            max_total_threadgroups_per_mesh_grid: usize,
        );

        /// Sets number of samples this pipeline applies for each fragment.
        #[unsafe(method(rasterSampleCount))]
        #[unsafe(method_family = none)]
        pub fn raster_sample_count(&self) -> usize;

        /// Setter for [`rasterSampleCount`][Self::rasterSampleCount].
        #[unsafe(method(setRasterSampleCount:))]
        #[unsafe(method_family = none)]
        pub fn set_raster_sample_count(&self, raster_sample_count: usize);

        /// Indicates whether to read and use the alpha channel fragment output of color attachments to compute a sample coverage mask.
        #[unsafe(method(alphaToCoverageState))]
        #[unsafe(method_family = none)]
        pub fn alpha_to_coverage_state(&self) -> MTL4AlphaToCoverageState;

        /// Setter for [`alphaToCoverageState`][Self::alphaToCoverageState].
        #[unsafe(method(setAlphaToCoverageState:))]
        #[unsafe(method_family = none)]
        pub fn set_alpha_to_coverage_state(
            &self,
            alpha_to_coverage_state: MTL4AlphaToCoverageState,
        );

        /// Indicates whether the pipeline forces alpha channel values of color attachments to the largest representable value.
        #[unsafe(method(alphaToOneState))]
        #[unsafe(method_family = none)]
        pub fn alpha_to_one_state(&self) -> MTL4AlphaToOneState;

        /// Setter for [`alphaToOneState`][Self::alphaToOneState].
        #[unsafe(method(setAlphaToOneState:))]
        #[unsafe(method_family = none)]
        pub fn set_alpha_to_one_state(&self, alpha_to_one_state: MTL4AlphaToOneState);

        /// Determines whether the pipeline rasterizes primitives.
        ///
        /// By default, this value is
        /// <doc
        /// ://com.apple.documentation/documentation/swift/true>, specifying that this pipeline
        /// rasterizes primitives. Set this property to
        /// <doc
        /// ://com.apple.documentation/documentation/swift/false> when you
        /// don't provide a fragment shader function via function ``fragmentFunctionDescriptor``.
        #[unsafe(method(isRasterizationEnabled))]
        #[unsafe(method_family = none)]
        pub fn is_rasterization_enabled(&self) -> bool;

        /// Setter for [`isRasterizationEnabled`][Self::isRasterizationEnabled].
        #[unsafe(method(setRasterizationEnabled:))]
        #[unsafe(method_family = none)]
        pub fn set_rasterization_enabled(&self, rasterization_enabled: bool);

        /// Determines the maximum value that can you can pass as the pipeline's amplification count.
        ///
        /// This property controls the maximum count you pass to ``MTL4RenderCommandEncoder/setVertexAmplificationCount:viewMappings:``
        /// when using vertex amplification with this pipeline.
        #[unsafe(method(maxVertexAmplificationCount))]
        #[unsafe(method_family = none)]
        pub fn max_vertex_amplification_count(&self) -> usize;

        /// Setter for [`maxVertexAmplificationCount`][Self::maxVertexAmplificationCount].
        #[unsafe(method(setMaxVertexAmplificationCount:))]
        #[unsafe(method_family = none)]
        pub fn set_max_vertex_amplification_count(
            &self,
            max_vertex_amplification_count: usize,
        );

        /// Accesses an array containing descriptions of the color attachments this pipeline writes to.
        #[unsafe(method(colorAttachments))]
        #[unsafe(method_family = none)]
        pub fn color_attachments(
            &self,
        ) -> Retained<MTL4RenderPipelineColorAttachmentDescriptorArray>;

        /// Provides static linking information for the object stage of the render pipeline.
        ///
        /// Use this property to link extra shader functions to the object stage of the render pipeline.
        #[unsafe(method(objectStaticLinkingDescriptor))]
        #[unsafe(method_family = none)]
        pub fn object_static_linking_descriptor(
            &self,
        ) -> Retained<MTL4StaticLinkingDescriptor>;

        /// Setter for [`objectStaticLinkingDescriptor`][Self::objectStaticLinkingDescriptor].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setObjectStaticLinkingDescriptor:))]
        #[unsafe(method_family = none)]
        pub fn set_object_static_linking_descriptor(
            &self,
            object_static_linking_descriptor: Option<&MTL4StaticLinkingDescriptor>,
        );

        /// Provides static linking information for the mesh stage of the render pipeline.
        ///
        /// Use this property to link extra shader functions to the mesh stage of the render pipeline.
        #[unsafe(method(meshStaticLinkingDescriptor))]
        #[unsafe(method_family = none)]
        pub fn mesh_static_linking_descriptor(
            &self,
        ) -> Retained<MTL4StaticLinkingDescriptor>;

        /// Setter for [`meshStaticLinkingDescriptor`][Self::meshStaticLinkingDescriptor].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setMeshStaticLinkingDescriptor:))]
        #[unsafe(method_family = none)]
        pub fn set_mesh_static_linking_descriptor(
            &self,
            mesh_static_linking_descriptor: Option<&MTL4StaticLinkingDescriptor>,
        );

        /// Provides static linking information for the fragment stage of the render pipeline.
        ///
        /// Use this property to link extra shader functions to the fragment stage of the render pipeline.
        #[unsafe(method(fragmentStaticLinkingDescriptor))]
        #[unsafe(method_family = none)]
        pub fn fragment_static_linking_descriptor(
            &self,
        ) -> Retained<MTL4StaticLinkingDescriptor>;

        /// Setter for [`fragmentStaticLinkingDescriptor`][Self::fragmentStaticLinkingDescriptor].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setFragmentStaticLinkingDescriptor:))]
        #[unsafe(method_family = none)]
        pub fn set_fragment_static_linking_descriptor(
            &self,
            fragment_static_linking_descriptor: Option<&MTL4StaticLinkingDescriptor>,
        );

        /// Indicates whether you can use the render pipeline to create new pipelines by adding binary functions to the object
        /// shader function’s callable functions list.
        #[unsafe(method(supportObjectBinaryLinking))]
        #[unsafe(method_family = none)]
        pub fn support_object_binary_linking(&self) -> bool;

        /// Setter for [`supportObjectBinaryLinking`][Self::supportObjectBinaryLinking].
        #[unsafe(method(setSupportObjectBinaryLinking:))]
        #[unsafe(method_family = none)]
        pub fn set_support_object_binary_linking(&self, support_object_binary_linking: bool);

        /// Indicates whether you can use the render pipeline to create new pipelines by adding binary functions to the mesh
        /// shader function’s callable functions list.
        #[unsafe(method(supportMeshBinaryLinking))]
        #[unsafe(method_family = none)]
        pub fn support_mesh_binary_linking(&self) -> bool;

        /// Setter for [`supportMeshBinaryLinking`][Self::supportMeshBinaryLinking].
        #[unsafe(method(setSupportMeshBinaryLinking:))]
        #[unsafe(method_family = none)]
        pub fn set_support_mesh_binary_linking(&self, support_mesh_binary_linking: bool);

        /// Indicates whether you can use the render pipeline to create new pipelines by adding binary functions to the fragment
        /// shader function’s callable functions list.
        #[unsafe(method(supportFragmentBinaryLinking))]
        #[unsafe(method_family = none)]
        pub fn support_fragment_binary_linking(&self) -> bool;

        /// Setter for [`supportFragmentBinaryLinking`][Self::supportFragmentBinaryLinking].
        #[unsafe(method(setSupportFragmentBinaryLinking:))]
        #[unsafe(method_family = none)]
        pub fn set_support_fragment_binary_linking(
            &self,
            support_fragment_binary_linking: bool,
        );

        /// Sets the logical-to-physical rendering remap state.
        ///
        /// Use this property to assign how a ``MTL4RenderCommandEncoder`` instance maps the output of your fragment shader to
        /// physical color attachments.
        #[unsafe(method(colorAttachmentMappingState))]
        #[unsafe(method_family = none)]
        pub fn color_attachment_mapping_state(
            &self,
        ) -> MTL4LogicalToPhysicalColorAttachmentMappingState;

        /// Setter for [`colorAttachmentMappingState`][Self::colorAttachmentMappingState].
        #[unsafe(method(setColorAttachmentMappingState:))]
        #[unsafe(method_family = none)]
        pub fn set_color_attachment_mapping_state(
            &self,
            color_attachment_mapping_state: MTL4LogicalToPhysicalColorAttachmentMappingState,
        );

        /// Indicates whether the pipeline supports indirect command buffers.
        #[unsafe(method(supportIndirectCommandBuffers))]
        #[unsafe(method_family = none)]
        pub fn support_indirect_command_buffers(
            &self,
        ) -> MTL4IndirectCommandBufferSupportState;

        /// Setter for [`supportIndirectCommandBuffers`][Self::supportIndirectCommandBuffers].
        #[unsafe(method(setSupportIndirectCommandBuffers:))]
        #[unsafe(method_family = none)]
        pub fn set_support_indirect_command_buffers(
            &self,
            support_indirect_command_buffers: MTL4IndirectCommandBufferSupportState,
        );

        /// Resets this descriptor to its default state.
        #[unsafe(method(reset))]
        #[unsafe(method_family = none)]
        pub fn reset(&self);
    );
}

/// Methods declared on superclass `NSObject`.
impl MTL4MeshRenderPipelineDescriptor {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}
