Render Pipelines

Specify how graphics primitives should be rendered.


A rendering pipeline consists of custom functions you provide to process graphics commands on the GPU. The order that functions are executed in a render pipeline is defined by Metal, but you supply the function implementations. Set up pipeline objects ahead of time (typically, at initialization) because pipelines are expensive to create, but quick to reuse.


Creating Render Pipeline State Objects

class MTLRenderPipelineDescriptor

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

class MTLTileRenderPipelineDescriptor

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

protocol MTLRenderPipelineState

An object that contains the graphics functions and configuration state used in a render pass.

Creating Depth and Stencil Objects

class MTLDepthStencilDescriptor

An object that configures new MTLDepthStencilState objects.

class MTLStencilDescriptor

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

protocol MTLDepthStencilState

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

Viewing Pipeline Statistics

Optimizing Performance with Pipeline Statistics

Decide how to tune your encoder performance by identifying your app's longest-running encoders and their primary GPU activity.

Optimizing Performance with GPU Counters

Examine granular metrics for your rendering or compute calls, and tune your app as needed.

See Also


Creating and Sampling Textures

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

Generating Multiple Output Vertex Streams from One Input Stream

Render efficiently to multiple layers or viewports.

class MTLRenderPassDescriptor

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

protocol MTLRenderCommandEncoder

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

protocol MTLParallelRenderCommandEncoder

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.