<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLRenderPipelineDescriptor",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(cs)MTLRenderPipelineDescriptor"
  },
  "title" : "MTLRenderPipelineDescriptor"
}
-->

# MTLRenderPipelineDescriptor

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

```
class MTLRenderPipelineDescriptor
```

## Overview

An [`MTLRenderPipelineDescriptor`](/documentation/Metal/MTLRenderPipelineDescriptor) instance configures the state of the pipeline to use during a rendering pass, including rasterization (such as multisampling), visibility, blending, tessellation, and graphics function state. Use standard allocation and initialization techniques to create an [`MTLRenderPipelineDescriptor`](/documentation/Metal/MTLRenderPipelineDescriptor) object. Then configure and use the descriptor to create an [`MTLRenderPipelineState`](/documentation/Metal/MTLRenderPipelineState) object.

To specify the vertex or fragment function in the rendering pipeline descriptor, set the [`vertexFunction`](/documentation/Metal/MTLRenderPipelineDescriptor/vertexFunction) or [`fragmentFunction`](/documentation/Metal/MTLRenderPipelineDescriptor/fragmentFunction) property, respectively, to the desired [`MTLFunction`](/documentation/Metal/MTLFunction) object. The system ignores the tessellation stage properties if you don’t set the [`vertexFunction`](/documentation/Metal/MTLRenderPipelineDescriptor/vertexFunction) property to a post-tessellation vertex function. A vertex function is a post-tessellation vertex function if the `[[ patch(patch-type, N) ]]` attribute precedes the function’s signature in your Metal Shading Language source. See the “Post-Tessellation Vertex Functions” section of [Metal Shading Language Specification](https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf) for more information.

Setting the [`fragmentFunction`](/documentation/Metal/MTLRenderPipelineDescriptor/fragmentFunction) property to `nil` disables the rasterization of pixels into the color attachment. This action is typically for outputting vertex function data into a buffer object, or for depth-only rendering.

If the vertex shader has an argument with per-vertex input attributes, set the [`vertexDescriptor`](/documentation/Metal/MTLRenderPipelineDescriptor/vertexDescriptor) property to an [`MTLVertexDescriptor`](/documentation/Metal/MTLVertexDescriptor) object that describes the organization of that vertex data.

### Multisampling and the render pipeline

If a color attachment supports multisampling (essentially, the attachment is an [`MTLTextureType.type2DMultisample`](/documentation/Metal/MTLTextureType/type2DMultisample) type color texture), you can create multiple samples per fragment, and the following rendering pipeline descriptor properties determine coverage:

- [`rasterSampleCount`](/documentation/Metal/MTLRenderPipelineDescriptor/rasterSampleCount) is the number of samples for each pixel.
- If [`isAlphaToCoverageEnabled`](/documentation/Metal/MTLRenderPipelineDescriptor/isAlphaToCoverageEnabled) is <doc://com.apple.documentation/documentation/Swift/true>, the GPU uses the alpha channel fragment output for [`colorAttachments`](/documentation/Metal/MTLRenderPipelineDescriptor/colorAttachments) to compute a coverage mask that affects the values the GPU writes to all attachments (color, depth, and stencil).
- If [`isAlphaToOneEnabled`](/documentation/Metal/MTLRenderPipelineDescriptor/isAlphaToOneEnabled) is <doc://com.apple.documentation/documentation/Swift/true>, the GPU changes alpha channel fragment values for [`colorAttachments`](/documentation/Metal/MTLRenderPipelineDescriptor/colorAttachments) to `1.0`, which is the largest representable value.

If [`isAlphaToCoverageEnabled`](/documentation/Metal/MTLRenderPipelineDescriptor/isAlphaToCoverageEnabled) is <doc://com.apple.documentation/documentation/Swift/true>, an implementation-defined `coverageToMask` function uses the alpha channel fragment output from [`colorAttachments`](/documentation/Metal/MTLRenderPipelineDescriptor/colorAttachments) to create an intermediate coverage mask, which sets a number of bits in its output proportionally to the value of the floating-point input. For example, if the input is `0.0f`, the function sets the output to `0x0`. If the input is `1.0f`, the function sets all output bits (in effect, `~0x0`). If the input is `0.5f`, the function sets half of the bits, according to the implementation, which often uses dither patterns.

To determine a final coverage mask, the function performs a logical `AND` on the resulting coverage mask `alphaCoverageMask` with the masks from the rasterizer and fragment shader, as the following code shows:

```objective-c
if (alphaToCoverageEnabled) then
    alphaCoverageMask = coverageToMask(colorAttachment0.alpha);

finalCoverageMask = originalRasterizerCoverageMask
                    & alphaCoverageMask
                    & fragShaderSampleMaskOutput;
```

## Topics

### Identifying the render pipeline state object

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

A string that identifies the render pipeline descriptor.

### Specifying graphics functions and associated data

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

The vertex function the pipeline calls to process vertices.

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

The fragment function the pipeline calls to process fragments.

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

The maximum function call depth from the top-most vertex shader function.

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

The maximum function call depth from the top-most fragment shader function.

### Specifying buffer layouts and fetch behavior

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

The organization of vertex data in an attribute’s argument table.

### Specifying buffer mutability

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

An array that contains the buffer mutability options for a render pipeline’s vertex function.

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

An array that contains the buffer mutability options for a render pipeline’s fragment function.

### Specifying rendering pipeline state

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

Specifies the default rendering pipeline state values for the descriptor.

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

An array of attachments that store color data.

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

The pixel format of the attachment that stores depth data.

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

The pixel format of the attachment that stores stencil data.

### Specifying rasterization and visibility state

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

A Boolean value that indicates whether to read and use the alpha channel fragment output for color attachments to compute a sample coverage mask.

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

A Boolean value that indicates whether to force alpha channel values for color attachments to the largest representable value.

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

A Boolean value that determines whether the pipeline rasterizes primitives.

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

The type of primitive topology the pipeline renders.

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

The number of samples the pipeline applies for each fragment.

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

The primitive topologies available for rendering.

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

The number of samples the pipeline applies for each fragment.

### Specifying tessellation state

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

The maximum tessellation factor that the tessellator uses when tessellating patches.

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

A Boolean value that determines whether the pipeline scales the tessellation factor.

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

The format of the tessellation factors in the tessellation factor buffer.

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

The size of the control point indices in a control point index buffer.

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

The step function for determining the tessellation factors for a patch from the tessellation factor buffer.

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

The winding order of triangles from the tessellator.

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

The partitioning mode that the tessellator uses to derive the number and spacing of segments for subdividing a corresponding edge.

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

Options for specifying the format of the tessellation factors in a tessellation factor buffer.

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

Options for specifying the size of the control point indices in a control point index buffer.

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

Options for specifying the step function that determines the tessellation factors for a patch from the tessellation factor buffer.

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

Options for choosing the partition mode that the tessellator applies when deriving
the number and spacing of segments for subdividing a corresponding edge.

### Specifying indirect command buffers usage

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

A Boolean value that determines whether you can encode commands into an indirect command buffer using the render pipeline.

### Specifying the maximum vertex amplification count

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

The maximum vertex amplification count you can set when encoding render commands.

### Specifying precompiled shader binaries

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

A Boolean value that indicates whether you can use the pipeline to create new pipelines by adding binary functions to the vertex shader’s callable functions list.

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

A Boolean value that indicates whether you can use the pipeline to create new pipelines by adding binary functions to the fragment shader’s callable functions list.

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

An array of binary archives to search for precompiled versions of the shader.

### Specifying callable functions for the pipeline

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

Functions that you can specify as function arguments for the vertex shader when encoding commands that use the pipeline.

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

Functions that you can specify as function arguments for the fragment shader when encoding commands that use the pipeline.

### Specifying shader validation

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

A value that enables or disables shader validation for the pipeline.



---

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)