MTLStages
The segments of command execution within the Metal pass types.
Declaration
struct MTLStagesMentioned in
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
Compute pass stages
Resource pass stages
Convenience values
Swift support
See Also
Synchronizing with barriers and fences
Synchronizing stages within a passSynchronizing passes with a fenceSynchronizing passes with consumer barriersSynchronizing passes with producer barriersSynchronizing CPU and GPU workImplementing a multistage image filter using heaps and fencesMTLFenceMTLRenderStagesMTLBarrierScopeMTL4VisibilityOptions