Render Pipeline

A specification for 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 expesive to create, but quick to reuse.


Basic Render Pipelines

protocol MTLRenderPipelineState

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

class MTLRenderPipelineDescriptor

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

Depth and Stencil

protocol MTLDepthStencilState

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

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.

Tile Shading

class MTLTileRenderPipelineDescriptor

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

Statistics Viewing

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


Basic Buffers

Demonstrates how to manage hundreds of vertices with a vertex buffer.

Creating and Sampling Textures

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

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 it can be simultaneously encoded from multiple threads.

Render Pass

A collection of commands that updates a set of render targets.

Vertex Data

Points that specify precise locations within the textures associated with graphics processing.

Presentation Objects

Various user interface elements you use to display your Metal content onscreen.