---
title: "setComputePipelineState(_:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtl4computecommandencoder/setcomputepipelinestate(_:)"
---

# setComputePipelineState(_:)

Configures this encoder with a compute pipeline state that applies to your subsequent dispatch commands.

## Declaration

```swift
func setComputePipelineState(_ state: any MTLComputePipelineState)
```

## Parameters

- `state`: A non-nil doc://com.apple.metal/documentation/Metal/MTLComputePipelineState.

## See Also

### Configuring the pass

- [setArgumentTable(_:)](metal/mtl4computecommandencoder/setargumenttable(_:).md)
- [setThreadgroupMemoryLength(_:index:)](metal/mtl4computecommandencoder/setthreadgroupmemorylength(_:index:).md)
- [setImageblockSize(width:height:)](metal/mtl4computecommandencoder/setimageblocksize(width:height:).md)
