An object used to customize how a new compute pipeline state object is compiled.


@interface MTLComputePipelineDescriptor : NSObject


To create a MTLComputePipelineState object, you create a pipeline descriptor, configure its properties, and pass it to one of the creation methods on a MTLDevice object. See Creating a Compute Pipeline.

Use standard allocation and initialization techniques to create a MTLComputePipelineDescriptor object and configure its properties. The most important property to set is the computeFunction property, which specifies which Metal function to call.


Specifying the Compute Function and Associated Data


The compute function to be compiled into the pipeline state object.


A Boolean that indicates whether the threadgroup size must always be a multiple of the thread execution width.


The maximum number of threads allowed for a threadgroup dispatched to the compute function.

Specifying Buffer Layouts and Fetch Behavior


The organization of input and output data for the compute function.


An object that describes the input and output data of a function.


An object that describes an argument's format and where its data is stored in memory.


An object that configures how input data for an attribute is fetched by a function.

Specifying Buffer Mutability


The buffer mutability options for a compute pipeline's kernel function.


An object that contains the mutability options for buffers used in a render or compute pass.

Identifying the Pipeline State Object


A string that identifies this object.

Setting Indirect Command Buffer Support

Resetting the Compute Pipeline State

- reset

Resets all compute pipeline descriptor properties to their default values.


Inherits From

Conforms To

See Also

Parallel Computation

Hello Compute

Demonstrates how to perform data-parallel computations using the GPU.

Creating Threads and Threadgroups

Learn how Metal organizes compute-processing workloads.

Calculating Threadgroup and Grid Sizes

Calculate the optimum sizes for threadgroups and grids when dispatching compute-processing workloads.


An object that contains a compiled compute pipeline.


An object used to encode commands in a compute pass.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software