---
title: "setComputePipelineStates(_:with:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlargumentencoder/setcomputepipelinestates(_:with:)"
---

# setComputePipelineStates(_:with:)

Encodes references to an array of compute pipeline states into the argument buffer.

## Declaration

```swift
func setComputePipelineStates(_ pipelines: UnsafePointer<(any MTLComputePipelineState)?>, with range: NSRange)
```

## Parameters

- `pipelines`: An array of pipeline states the method encodes.
- `range`: A range of indices within the argument buffer for each element in pipelines. The values correspond to either the index IDs of declarations in Metal Shading Language (MSL) or the doc://com.apple.metal/documentation/Metal/MTLArgumentDescriptor/index property of doc://com.apple.metal/documentation/Metal/MTLArgumentDescriptor instances.

## See Also

### Encoding pipeline states

- [setRenderPipelineState(_:index:)](metal/mtlargumentencoder/setrenderpipelinestate(_:index:).md)
- [setRenderPipelineStates(_:range:)](metal/mtlargumentencoder/setrenderpipelinestates(_:range:).md)
- [setComputePipelineState(_:index:)](metal/mtlargumentencoder/setcomputepipelinestate(_:index:).md)
- [setComputePipelineState(_:at:)](metal/mtlargumentencoder/setcomputepipelinestate(_:at:).md)
- [setComputePipelineStates(_:range:)](metal/mtlargumentencoder/setcomputepipelinestates(_:range:).md)
