---
title: "makeComputePipelineState(function:options:reflection:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtldevice/makecomputepipelinestate(function:options:reflection:)"
---

# makeComputePipelineState(function:options:reflection:)

Synchronously creates a compute pipeline state and reflection with a function instance.

## Declaration

```swift
func makeComputePipelineState(function computeFunction: any MTLFunction, options: MTLPipelineOption, reflection: AutoreleasingUnsafeMutablePointer<MTLAutoreleasedComputePipelineReflection?>?) throws -> any MTLComputePipelineState
```

## Parameters

- `computeFunction`: An doc://com.apple.metal/documentation/Metal/MTLFunction instance.
- `options`: An doc://com.apple.metal/documentation/Metal/MTLPipelineOption instance that represents the reflection information you want the method to generate.
- `reflection`: In Swift, an optional pointer to an doc://com.apple.metal/documentation/Metal/MTLAutoreleasedComputePipelineReflection optional. In Objective-C, a pointer to an doc://com.apple.metal/documentation/Metal/MTLAutoreleasedComputePipelineReflection instance.

## Discussion

Discussion Use the compute pipeline state to configure a compute pass by calling the setComputePipelineState(_:) method of an MTLComputeCommandEncoder instance.

## See Also

### Creating compute pipeline states

- [makeComputePipelineState(descriptor:options:reflection:)](metal/mtldevice/makecomputepipelinestate(descriptor:options:reflection:).md)
- [makeComputePipelineState(descriptor:options:completionHandler:)](metal/mtldevice/makecomputepipelinestate(descriptor:options:completionhandler:).md)
- [makeComputePipelineState(function:)](metal/mtldevice/makecomputepipelinestate(function:).md)
- [makeComputePipelineState(function:completionHandler:)](metal/mtldevice/makecomputepipelinestate(function:completionhandler:).md)
- [makeComputePipelineState(function:options:completionHandler:)](metal/mtldevice/makecomputepipelinestate(function:options:completionhandler:).md)
