---
title: MTLStages
framework: metal
role: symbol
role_heading: Structure
path: metal/mtlstages
---

# MTLStages

The segments of command execution within the Metal pass types.

## Declaration

```swift
struct MTLStages
```

## Mentioned in

Synchronizing passes with a fence Synchronizing passes with consumer barriers Synchronizing passes with producer barriers Synchronizing stages within a pass

## Overview

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 instances encode render passes that run vertex, fragment, object, mesh, and tile stages. MTL4ComputeCommandEncoder instances encode unified compute passes that run blit, dispatch, and acceleration structure stages. MTL4MachineLearningCommandEncoder instances encode passes that run machine learning stages. Metal 3 provides separate command encoders for different types of work: MTLRenderCommandEncoder instances encode render passes that run vertex, fragment, object, mesh, and tile stages. MTLComputeCommandEncoder instances encode compute passes that run dispatch stages. MTLBlitCommandEncoder instances encode blit passes that run blit stages, which initialize and copy data for resources, such as buffers and textures. MTLAccelerationStructureCommandEncoder instances encode passes that run acceleration structure stages, such as for ray tracing.

## Topics

### Render pass stages

- [vertex](metal/mtlstages/vertex.md)
- [fragment](metal/mtlstages/fragment.md)
- [tile](metal/mtlstages/tile.md)
- [object](metal/mtlstages/object.md)
- [mesh](metal/mtlstages/mesh.md)

### Compute pass stages

- [dispatch](metal/mtlstages/dispatch.md)
- [blit](metal/mtlstages/blit.md)
- [accelerationStructure](metal/mtlstages/accelerationstructure.md)
- [machineLearning](metal/mtlstages/machinelearning.md)

### Resource pass stages

- [resourceState](metal/mtlstages/resourcestate.md)

### Convenience values

- [all](metal/mtlstages/all.md)

### Swift support

- [init(rawValue:)](metal/mtlstages/init(rawvalue:).md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)
- [Equatable](swift/equatable.md)
- [ExpressibleByArrayLiteral](swift/expressiblebyarrayliteral.md)
- [OptionSet](swift/optionset.md)
- [RawRepresentable](swift/rawrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [SetAlgebra](swift/setalgebra.md)

## See Also

### Synchronizing with barriers and fences

- [Synchronizing stages within a pass](metal/synchronizing-stages-within-a-pass.md)
- [Synchronizing passes with a fence](metal/synchronizing-passes-with-a-fence.md)
- [Synchronizing passes with consumer barriers](metal/synchronizing-passes-with-consumer-barriers.md)
- [Synchronizing passes with producer barriers](metal/synchronizing-passes-with-producer-barriers.md)
- [Synchronizing CPU and GPU work](metal/synchronizing-cpu-and-gpu-work.md)
- [Implementing a multistage image filter using heaps and fences](metal/implementing-a-multistage-image-filter-using-heaps-and-fences.md)
- [MTLFence](metal/mtlfence.md)
- [MTLRenderStages](metal/mtlrenderstages.md)
- [MTLBarrierScope](metal/mtlbarrierscope.md)
- [MTL4VisibilityOptions](metal/mtl4visibilityoptions.md)
