<!--
{
  "documentType" : "article",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/render-passes",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Render passes"
}
-->

# Render passes

Encode a render pass to draw graphics into an image.

## Discussion

A render pass processes and rasterizes geometry to one or more output attachments using a render pipeline.

Render passes consist of:

- A set of input resources, such as buffers and textures
- A render pipeline that configures the GPU that does work with the input resources
- Draw commands
- Vertex shaders, the GPU core functions that process and transform a scene’s geometry
- An optional tessellation stage that adds fine details to a scene’s geometry
- Fragment shaders, the GPU core functions that produce the final color values for each pixel
- Optional outputs that can include color, depth, and stencil attachments, and their load and store operations

See the [Customizing render pass setup](/documentation/Metal/customizing-render-pass-setup) sample for implementation details.

## Topics

### Encoding a render pass

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

Encodes configuration and draw commands for a single render pass into a command buffer.

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

Encodes configuration and draw commands for a single render pass into a command buffer.

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

Custom render pass options you specify at encoder creation time.

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

Specifies how to rasterize triangle and triangle strip primitives.

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

The vertex winding rule that determines a front-facing primitive.

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

The mode that determines whether to perform culling and which type of primitive to cull.

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

The geometric primitive type for drawing commands.

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

The index type for an index buffer that references vertices of geometric primitives.

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

The mode that determines how to deal with fragments outside of the near or far planes.

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

The mode that determines what, if anything, the GPU writes to the results buffer, after the GPU executes the render pass.

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

This enumeration controls if Metal accumulates visibility results between render encoders or resets them.

### Encoding a render pass in parallel

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

An instance that splits up a single render pass so that it can be simultaneously encoded from multiple threads.

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

Types of actions performed for an attachment at the start of a rendering pass.

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

Types of actions performed for an attachment at the end of a rendering pass.

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

Options that modify a store action.

### Configuring a render command encoder

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

Describes a render pass.

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

A group of render targets that hold the results of a render pass.

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

A render target that serves as the output destination for pixels generated by a render pass.

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

An array of render pass color attachment descriptor objects.

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

A color render target that serves as the output destination for color pixels generated by a render pass.

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

An RGBA value used for a color pixel.

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

A depth render target that serves as the output destination for depth pixels generated by a render pass.

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

Filtering options for controlling an MSAA depth resolve operation.

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

An array of color attachment descriptions for a render pipeline.

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

An array of color attachment descriptors for the tile render pipeline.

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

A stencil render target that serves as the output destination for stencil pixels generated by a render pass.

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

Constants used to control the multisample stencil resolve operation.

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

An array of sample buffer attachments for a render pass.

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

A description of where to store GPU counter information at the start and end of a render pass.

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

Allows you to easily specify color attachment remapping from logical to physical indices.

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

### Render pipeline states

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

An interface that represents a graphics pipeline configuration for a render pass, which the pass applies to the draw commands you encode.

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

Groups together properties to create a render pipeline state object.

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

An argument of options you pass to a GPU device to get a render pipeline state.

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

A collection of functions for updating a render pipeline.

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

Groups together properties you use to create a mesh render pipeline state object.

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

An object that configures new render pipeline state objects for mesh shading.

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

The mutability options for a buffer that a render or compute pipeline uses.

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

An array of pipeline buffer descriptors.

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

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

A color render target that specifies the color configuration and color operations for a render pipeline.

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

An array of render pipeline color attachment descriptor objects.

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

Groups together properties you use to create a tile render pipeline state object.

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

An object that configures new render pipeline state objects for tile shading.

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

A description of a tile-shading render pipeline’s color render target.

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

Options that determine how Metal prepares the pipeline.

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

Allows you to specify additional binary functions to link to each stage of a render pipeline.

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

Groups together properties that provide linking properties for render pipelines.

### Dynamic render pipeline states

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

A 3D rectangular region for the viewport clipping.

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

A rectangle for the scissor fragment test.

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

An offset applied to a render target index and viewport index.

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

The per-patch tessellation factors for a quad patch.

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

The per-patch tessellation factors for a triangle patch.

### Render pass inputs

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

An instance that describes how to organize and map data to a vertex function.

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

An object that determines how to store attribute data in memory and map it to the arguments of a vertex function.

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

An array of vertex attribute descriptor instances.

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

An object that configures how a render pipeline fetches data to send to the vertex function.

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

An array of vertex buffer layout descriptor instances.

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

### Render pass outputs

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

A displayable resource that can be rendered or written to.

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

A block of code invoked after a drawable is presented.

### Depth testing

[Calculating primitive visibility using depth testing](/documentation/Metal/calculating-primitive-visibility-using-depth-testing)

Determine which pixels are visible in a scene by using a depth texture.

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

A depth and stencil state instance that specifies the depth and stencil configuration and operations used in a render pass.

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

An instance that configures new [`MTLDepthStencilState`](/documentation/Metal/MTLDepthStencilState) instances.

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

An object that defines the front-facing or back-facing stencil operations of a depth and stencil state object.

### Rasterization settings

[Rendering at different rasterization rates](/documentation/Metal/rendering-at-different-rasterization-rates)

Configure a rasterization rate map to vary rasterization rates depending on the amount of detail needed.

[Creating a rasterization rate map](/documentation/Metal/creating-a-rasterization-rate-map)

Define the rasterization rates for each part of your render target.

[Rendering with a rasterization rate map](/documentation/Metal/rendering-with-a-rasterization-rate-map)

Create offscreen textures to hold intermediate rasterized data.

[Scaling variable rasterization rate content](/documentation/Metal/scaling-variable-rasterization-rate-content)

Use the rate map data to scale the content to fill your destination texture.

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

An object that you use to configure new rasterization rate maps.

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

A compiled read-only instance that determines how to apply variable rasterization rates when rendering.

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

A coordinate in the viewport.

[`MTLCoordinate2DMake(_:_:)`](/documentation/Metal/MTLCoordinate2DMake(_:_:))

Returns a new 2D point with the specified coordinates.

### Optimizing techniques

[Specifying drawing and dispatch arguments indirectly](/documentation/Metal/specifying-drawing-and-dispatch-arguments-indirectly)

Use indirect commands if you don’t know your draw or dispatch call arguments when you encode the command.

[Rendering to multiple viewports in a draw command](/documentation/Metal/rendering-to-multiple-viewports-in-a-draw-command)

Select viewports and their corresponding scissor rectangles in your vertex shader.

[Rendering to multiple texture slices in a draw command](/documentation/Metal/rendering-to-multiple-texture-slices-in-a-draw-command)

Select a destination texture slice in your vertex shader.

### Advanced multisampling

[Positioning samples programmatically](/documentation/Metal/positioning-samples-programmatically)

Configure the position of samples when rendering to a multisampled render target.

[Storing data a pass makes with custom sample positions for a subsequent pass](/documentation/Metal/storing-data-a-pass-makes-with-custom-sample-positions-for-a-subsequent-pass)

Inform Metal when your app uses programmable sample positions for its depth render targets or copies MSAA depth data.

### Applying rendering techniques

[Drawing a triangle with Metal 4](/documentation/Metal/drawing-a-triangle-with-metal-4)

Render a colorful, rotating 2D triangle by running draw commands with a render pipeline on a GPU.

[Customizing render pass setup](/documentation/Metal/customizing-render-pass-setup)

Render into an offscreen texture by creating a custom render pass.

[Setting load and store actions](/documentation/Metal/setting-load-and-store-actions)

Set actions that define how a render pass loads and stores a render target.

[Improving rendering performance with vertex amplification](/documentation/Metal/improving-rendering-performance-with-vertex-amplification)

Run draw commands that render to different outputs using the same vertex data multiple times.



---

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)