<!--
{
  "documentType" : "article",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/pipeline-state-creation",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Pipeline state creation"
}
-->

# Pipeline state creation

Create pipeline states for render and compute passes, samplers, depth and stencil states, and indirect command buffers.

## Discussion

Use these methods to create instances of various state types for a render or compute pass (see [Render passes](/documentation/Metal/render-passes) and [Compute passes](/documentation/Metal/compute-passes), respectively).

You can create multiple [`MTLRenderPipelineState`](/documentation/Metal/MTLRenderPipelineState) instances for a single render pass encoder ([`MTLRenderCommandEncoder`](/documentation/Metal/MTLRenderCommandEncoder)) that each apply to different types of render commands. For example, a single render pass can render primitives with vertices, then meshes, and finish with a tile shader command, each with a different pipeline. To create these pipelines, configure instances of [`MTLRenderPipelineDescriptor`](/documentation/Metal/MTLRenderPipelineDescriptor), [`MTLMeshRenderPipelineDescriptor`](/documentation/Metal/MTLMeshRenderPipelineDescriptor), and [`MTLTileRenderPipelineDescriptor`](/documentation/Metal/MTLTileRenderPipelineDescriptor). Then pass those descriptors to the [`makeRenderPipelineState(descriptor:completionHandler:)`](/documentation/Metal/MTLDevice/makeRenderPipelineState(descriptor:completionHandler:)), [`makeRenderPipelineState(descriptor:options:completionHandler:)`](/documentation/Metal/MTLDevice/makeRenderPipelineState(descriptor:options:completionHandler:)-1wvya) and [`makeRenderPipelineState(tileDescriptor:options:completionHandler:)`](/documentation/Metal/MTLDevice/makeRenderPipelineState(tileDescriptor:options:completionHandler:)) methods (or a counterpart method), respectively.

> Important:
> Only create reflection (see ``doc://com.apple.metal/documentation/Metal/MTLRenderPipelineReflection``) instances if you need them, because each one can require a significant amount of memory.

## Topics

### Creating render pipeline states with vertex shaders

[`makeRenderPipelineState(descriptor:)`](/documentation/Metal/MTLDevice/makeRenderPipelineState(descriptor:))

Synchronously creates a render pipeline state.

[`makeRenderPipelineState(descriptor:completionHandler:)`](/documentation/Metal/MTLDevice/makeRenderPipelineState(descriptor:completionHandler:))

Asynchronously creates a render pipeline state.

[`makeRenderPipelineState(descriptor:options:)`](/documentation/Metal/MTLDevice/makeRenderPipelineState(descriptor:options:)-89vxc)

Synchronously creates a render pipeline state and reflection information in a tuple.

[`makeRenderPipelineState(descriptor:options:reflection:)`](/documentation/Metal/MTLDevice/makeRenderPipelineState(descriptor:options:reflection:))

Synchronously creates a render pipeline state and reflection information.

[`makeRenderPipelineState(descriptor:options:completionHandler:)`](/documentation/Metal/MTLDevice/makeRenderPipelineState(descriptor:options:completionHandler:)-5gdww)

Asynchronously creates a render pipeline state and reflection information.

### Creating render pipeline states with mesh shaders

[`makeRenderPipelineState(descriptor:options:)`](/documentation/Metal/MTLDevice/makeRenderPipelineState(descriptor:options:)-yrak)

Synchronously creates a mesh render pipeline state and reflection information in a tuple.

[`newRenderPipelineStateWithMeshDescriptor:options:reflection:error:`](/documentation/Metal/MTLDevice/newRenderPipelineStateWithMeshDescriptor:options:reflection:error:)

Synchronously creates a mesh render pipeline state and reflection information.

[`makeRenderPipelineState(descriptor:options:completionHandler:)`](/documentation/Metal/MTLDevice/makeRenderPipelineState(descriptor:options:completionHandler:)-1wvya)

Asynchronously creates a mesh render pipeline state and reflection information.

### Creating tile render pipeline states

[`makeRenderPipelineState(tileDescriptor:options:)`](/documentation/Metal/MTLDevice/makeRenderPipelineState(tileDescriptor:options:))

Synchronously creates a tile shader’s render pipeline state and reflection information in a tuple.

[`makeRenderPipelineState(tileDescriptor:options:reflection:)`](/documentation/Metal/MTLDevice/makeRenderPipelineState(tileDescriptor:options:reflection:))

Synchronously creates a tile shader’s render pipeline state and reflection information.

[`makeRenderPipelineState(tileDescriptor:options:completionHandler:)`](/documentation/Metal/MTLDevice/makeRenderPipelineState(tileDescriptor:options:completionHandler:))

Asynchronously creates a tile shader’s render pipeline state and reflection information.

### Creating compute pipeline states

[`makeComputePipelineState(descriptor:options:reflection:)`](/documentation/Metal/MTLDevice/makeComputePipelineState(descriptor:options:reflection:))

Synchronously creates a compute pipeline state and reflection information.

[`makeComputePipelineState(descriptor:options:completionHandler:)`](/documentation/Metal/MTLDevice/makeComputePipelineState(descriptor:options:completionHandler:))

Asynchronously creates a compute pipeline state and reflection information.

[`makeComputePipelineState(function:)`](/documentation/Metal/MTLDevice/makeComputePipelineState(function:))

Synchronously creates a compute pipeline state with a function instance.

[`makeComputePipelineState(function:completionHandler:)`](/documentation/Metal/MTLDevice/makeComputePipelineState(function:completionHandler:))

Asynchronously creates a compute pipeline state with a function instance.

[`makeComputePipelineState(function:options:reflection:)`](/documentation/Metal/MTLDevice/makeComputePipelineState(function:options:reflection:))

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

[`makeComputePipelineState(function:options:completionHandler:)`](/documentation/Metal/MTLDevice/makeComputePipelineState(function:options:completionHandler:))

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

### Creating depth and stencil states

[`makeDepthStencilState(descriptor:)`](/documentation/Metal/MTLDevice/makeDepthStencilState(descriptor:))

Creates a depth-stencil state instance.

### Supporting types

[`MTLNewRenderPipelineStateCompletionHandler`](/documentation/Metal/MTLNewRenderPipelineStateCompletionHandler)

A completion handler signature a method calls when it finishes creating a render pipeline.

[`MTLNewRenderPipelineStateWithReflectionCompletionHandler`](/documentation/Metal/MTLNewRenderPipelineStateWithReflectionCompletionHandler)

A completion handler signature a method calls when it finishes creating a render pipeline and reflection information.

[`MTLNewComputePipelineStateCompletionHandler`](/documentation/Metal/MTLNewComputePipelineStateCompletionHandler)

A completion handler signature a method calls when it finishes creating a compute pipeline.

[`MTLNewComputePipelineStateWithReflectionCompletionHandler`](/documentation/Metal/MTLNewComputePipelineStateWithReflectionCompletionHandler)

A completion handler signature a method calls when it finishes creating a compute pipeline and reflection information.



---

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)