Render Passes

Update a set of render targets.


The draw commands you encode with a single render command encoder correspond to a single render pass. Therefore, there's a 1:1 relationship between a render command encoder and a render pass.

On macOS, one of the ways that render passes surface in a Metal rendering workflow is when a group of draws must finish before another group of draws starts. For example, the Deferred Lighting sample code renders in two passes:

  1. Graphical elements are rendered to an offscreen texture

  2. The offscreen texture is analyzed and translated to a final rendering to the screen

Deferred Lighting employs a two-pass rendering strategy on macOS because the render targets differ across the two passes: offscreen texture, versus the screen. Also, the first set of render targets is input to the second render pass, and thererfore the second render pass is dependent on the completion of the work done by the first render pass.


Render Passes


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

Render Targets

A texture that's drawn to in a render pass.

Setting Load and Store Actions

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


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


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


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


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

Sample Positions

Positioning Samples Programmatically

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

Handling MSAA Depth with Programmable Sample Positions

Use depth render targets and programmable sample positions effectively.

Frame Dependency Graphs

Viewing Your Frame Graph

View your render passes as a flow chart to inspect resource dependencies and understand which commands wait on others to complete.

See Also


Creating and Sampling Textures

Load image data into a texture and apply it to a quadrangle.

Render Pipelines

Specify how graphics primitives should be rendered.


The object to use for encoding commands for a render pass.


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

Model I/O

Specify precise locations within the textures associated with graphics processing.

Presentation Objects

Use user interface elements to display your Metal content.