---
title: MTLComputePipelineState
framework: metal
role: symbol
role_heading: Protocol
path: metal/mtlcomputepipelinestate
---

# MTLComputePipelineState

An interface that represents a GPU pipeline configuration for running kernels in a compute pass.

## Declaration

```swift
protocol MTLComputePipelineState : MTLAllocation, Sendable
```

## Mentioned in

Calculating threadgroup and grid sizes Improving CPU performance by using argument buffers

## Overview

Overview The MTLComputePipelineState protocol is an interface that represents a specific configuration for the GPU pipeline for a compute pass. Use a pipeline state to configure a compute pass by calling the setComputePipelineState(_:) method of an MTLComputeCommandEncoder instance. To create a pipeline state, call the appropriate MTLDevice method (see Pipeline state creation). You typically make pipeline states at a noncritical time, like when your app first launches. This is because graphics drivers may need time to evaluate and build each pipeline state. However, you can quickly use and reuse each pipeline state throughout your app’s lifetime.

## Topics

### Identifying a pipeline state

- [device](metal/mtlcomputepipelinestate/device.md)
- [gpuResourceID](metal/mtlcomputepipelinestate/gpuresourceid.md)
- [label](metal/mtlcomputepipelinestate/label.md)

### Checking threadgroup attributes

- [maxTotalThreadsPerThreadgroup](metal/mtlcomputepipelinestate/maxtotalthreadsperthreadgroup.md)
- [threadExecutionWidth](metal/mtlcomputepipelinestate/threadexecutionwidth.md)
- [staticThreadgroupMemoryLength](metal/mtlcomputepipelinestate/staticthreadgroupmemorylength.md)

### Checking imageblock attributes

- [imageblockMemoryLength(forDimensions:)](metal/mtlcomputepipelinestate/imageblockmemorylength(fordimensions:).md)

### Checking indirect command buffer support

- [supportIndirectCommandBuffers](metal/mtlcomputepipelinestate/supportindirectcommandbuffers.md)

### Checking shader validation

- [shaderValidation](metal/mtlcomputepipelinestate/shadervalidation.md)

### Creating function handles

- [functionHandle(function:)](metal/mtlcomputepipelinestate/functionhandle(function:)-7d523.md)

### Adding visible functions

- [makeComputePipelineStateWithAdditionalBinaryFunctions(functions:)](metal/mtlcomputepipelinestate/makecomputepipelinestatewithadditionalbinaryfunctions(functions:).md)

### Creating function tables

- [makeVisibleFunctionTable(descriptor:)](metal/mtlcomputepipelinestate/makevisiblefunctiontable(descriptor:).md)
- [makeIntersectionFunctionTable(descriptor:)](metal/mtlcomputepipelinestate/makeintersectionfunctiontable(descriptor:).md)

### Instance Properties

- [reflection](metal/mtlcomputepipelinestate/reflection.md)
- [requiredThreadsPerThreadgroup](metal/mtlcomputepipelinestate/requiredthreadsperthreadgroup.md)

### Instance Methods

- [functionHandle(function:)](metal/mtlcomputepipelinestate/functionhandle(function:)-8spaa.md)
- [functionHandle(withName:)](metal/mtlcomputepipelinestate/functionhandle(withname:).md)
- [makeComputePipelineState(additionalBinaryFunctions:)](metal/mtlcomputepipelinestate/makecomputepipelinestate(additionalbinaryfunctions:).md)

## Relationships

### Inherits From

- [MTLAllocation](metal/mtlallocation.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Configuring a compute pipeline state

- [MTL4ComputePipelineDescriptor](metal/mtl4computepipelinedescriptor.md)
- [MTLComputePipelineDescriptor](metal/mtlcomputepipelinedescriptor.md)
- [MTLStageInputOutputDescriptor](metal/mtlstageinputoutputdescriptor.md)
- [MTLPipelineBufferDescriptor](metal/mtlpipelinebufferdescriptor.md)
- [MTLPipelineBufferDescriptorArray](metal/mtlpipelinebufferdescriptorarray.md)
- [MTLPipelineOption](metal/mtlpipelineoption.md)
