<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLStages",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:@E@MTLStages"
  },
  "title" : "MTLStages"
}
-->

# MTLStages

The segments of command execution within the Metal pass types.

```
struct MTLStages
```

## Overview

Metal associates each command with one or more stages within a pass.
Use these stage identifiers to synchronize command execution within a pass by selecting which stages wait for other stages to complete.

Metal 4 introduces the following unified command encoders that combine multiple stages into a single pass:

- [`MTL4RenderCommandEncoder`](/documentation/Metal/MTL4RenderCommandEncoder) instances encode render passes that run vertex, fragment, object, mesh, and tile stages.
- [`MTL4ComputeCommandEncoder`](/documentation/Metal/MTL4ComputeCommandEncoder) instances encode unified compute passes that run blit, dispatch, and acceleration structure stages.
- [`MTL4MachineLearningCommandEncoder`](/documentation/Metal/MTL4MachineLearningCommandEncoder) instances encode passes that run machine learning stages.

Metal 3 provides separate command encoders for different types of work:

- [`MTLRenderCommandEncoder`](/documentation/Metal/MTLRenderCommandEncoder) instances encode render passes that run vertex, fragment, object, mesh, and tile stages.
- [`MTLComputeCommandEncoder`](/documentation/Metal/MTLComputeCommandEncoder) instances encode compute passes that run dispatch stages.
- [`MTLBlitCommandEncoder`](/documentation/Metal/MTLBlitCommandEncoder) instances encode blit passes that run blit stages, which initialize and copy data for resources, such as buffers and textures.
- [`MTLAccelerationStructureCommandEncoder`](/documentation/Metal/MTLAccelerationStructureCommandEncoder) instances encode passes that run acceleration structure stages, such as for ray tracing.

## Topics

### Render pass stages

[`MTLStageVertex`](/documentation/Metal/MTLStages/vertex)

Represents all vertex shader stage work in a render pass.

[`MTLStageFragment`](/documentation/Metal/MTLStages/fragment)

Represents all fragment shader stage work in a render pass.

[`MTLStageTile`](/documentation/Metal/MTLStages/tile)

Represents all tile shading stage work in a render pass.

[`MTLStageObject`](/documentation/Metal/MTLStages/object)

Represents all object shader stage work in a render pass.

[`MTLStageMesh`](/documentation/Metal/MTLStages/mesh)

Represents all mesh shader stage work work in a render pass.

### Compute pass stages

[`MTLStageDispatch`](/documentation/Metal/MTLStages/dispatch)

Represents all compute dispatches in a compute pass.

[`MTLStageBlit`](/documentation/Metal/MTLStages/blit)

Represents all blit operations in a pass.

[`MTLStageAccelerationStructure`](/documentation/Metal/MTLStages/accelerationStructure)

Represents all acceleration structure operations.

[`MTLStageMachineLearning`](/documentation/Metal/MTLStages/machineLearning)

Represents all machine learning network dispatch operations.

### Resource pass stages

[`MTLStageResourceState`](/documentation/Metal/MTLStages/resourceState)

Represents all sparse and placement sparse resource mapping updates.

### Convenience values

[`MTLStageAll`](/documentation/Metal/MTLStages/all)

Convenience mask representing all stages of GPU work.

### Swift support

[`init(rawValue:)`](/documentation/Metal/MTLStages/init(rawValue:))

## Relationships

### Conforms To

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`OptionSet`](/documentation/Swift/OptionSet)

[`SetAlgebra`](/documentation/Swift/SetAlgebra)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`Equatable`](/documentation/Swift/Equatable)

[`Sendable`](/documentation/Swift/Sendable)

[`ExpressibleByArrayLiteral`](/documentation/Swift/ExpressibleByArrayLiteral)

---

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)