<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLDevice/makeComputePipelineState(descriptor:options:reflection:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLDevice(im)newComputePipelineStateWithDescriptor:options:reflection:error:"
  },
  "title" : "makeComputePipelineState(descriptor:options:reflection:)"
}
-->

# makeComputePipelineState(descriptor:options:reflection:)

Synchronously creates a compute pipeline state and reflection information.

```
func makeComputePipelineState(descriptor: MTLComputePipelineDescriptor, options: MTLPipelineOption, reflection: AutoreleasingUnsafeMutablePointer<MTLAutoreleasedComputePipelineReflection?>?) throws -> any MTLComputePipelineState
```

## Parameters

`descriptor`

An [`MTLComputePipelineDescriptor`](/documentation/Metal/MTLComputePipelineDescriptor) instance.

`options`

An [`MTLPipelineOption`](/documentation/Metal/MTLPipelineOption) instance that represents the reflection information you want the method to generate.

`reflection`

In Swift, an optional pointer to an [`MTLAutoreleasedComputePipelineReflection`](/documentation/Metal/MTLAutoreleasedComputePipelineReflection) optional.
In Objective-C, a pointer to an [`MTLAutoreleasedComputePipelineReflection`](/documentation/Metal/MTLAutoreleasedComputePipelineReflection) instance.

    Pass     `nil`     in either language when you don’t need reflection data.
    Otherwise on return, if the method completes successfully,
    it assigns an [`MTLComputePipelineReflection`](/documentation/Metal/MTLComputePipelineReflection)     instance to the pointee,
    which contains the details about the function arguments.

## Discussion

Use the compute pipeline state to configure a compute pass by calling the [`setComputePipelineState(_:)`](/documentation/Metal/MTLComputeCommandEncoder/setComputePipelineState(_:)) method of an [`MTLComputeCommandEncoder`](/documentation/Metal/MTLComputeCommandEncoder) instance.

---

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)