<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLComputePipelineState",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLComputePipelineState"
  },
  "title" : "MTLComputePipelineState"
}
-->

# MTLComputePipelineState

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

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

## Overview

The [`MTLComputePipelineState`](/documentation/Metal/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(_:)`](/documentation/Metal/MTLComputeCommandEncoder/setComputePipelineState(_:)) method of an [`MTLComputeCommandEncoder`](/documentation/Metal/MTLComputeCommandEncoder) instance.

To create a pipeline state, call the appropriate [`MTLDevice`](/documentation/Metal/MTLDevice) method (see [Pipeline state creation](/documentation/Metal/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`](/documentation/Metal/MTLComputePipelineState/device)

The device instance that created the pipeline state.

[`gpuResourceID`](/documentation/Metal/MTLComputePipelineState/gpuResourceID)

An unique identifier that represents the pipeline state, which you can add to an argument buffer.

[`label`](/documentation/Metal/MTLComputePipelineState/label)

A string that helps you identify the compute pipeline state during debugging.

### Checking threadgroup attributes

[`maxTotalThreadsPerThreadgroup`](/documentation/Metal/MTLComputePipelineState/maxTotalThreadsPerThreadgroup)

The maximum number of threads in a threadgroup that you can dispatch to the pipeline.

[`threadExecutionWidth`](/documentation/Metal/MTLComputePipelineState/threadExecutionWidth)

The number of threads that the GPU executes simultaneously.

[`staticThreadgroupMemoryLength`](/documentation/Metal/MTLComputePipelineState/staticThreadgroupMemoryLength)

The length, in bytes, of statically allocated threadgroup memory.

### Checking imageblock attributes

[`imageblockMemoryLength(forDimensions:)`](/documentation/Metal/MTLComputePipelineState/imageblockMemoryLength(forDimensions:))

Returns the length of reserved memory for an imageblock of a given size.

### Checking indirect command buffer support

[`supportIndirectCommandBuffers`](/documentation/Metal/MTLComputePipelineState/supportIndirectCommandBuffers)

A Boolean value that indicates whether the compute pipeline supports indirect command buffers.

### Checking shader validation

[`shaderValidation`](/documentation/Metal/MTLComputePipelineState/shaderValidation)

The current state of shader validation for the pipeline.

### Creating function handles

[`functionHandle(function:)`](/documentation/Metal/MTLComputePipelineState/functionHandle(function:)-7d523)

Creates a function handle for a visible function.

### Adding visible functions

[`makeComputePipelineStateWithAdditionalBinaryFunctions(functions:)`](/documentation/Metal/MTLComputePipelineState/makeComputePipelineStateWithAdditionalBinaryFunctions(functions:))

Creates a new pipeline state object with additional callable functions.

### Creating function tables

[`makeVisibleFunctionTable(descriptor:)`](/documentation/Metal/MTLComputePipelineState/makeVisibleFunctionTable(descriptor:))

Creates a new visible function table.

[`makeIntersectionFunctionTable(descriptor:)`](/documentation/Metal/MTLComputePipelineState/makeIntersectionFunctionTable(descriptor:))

Creates a new intersection function table.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)