---
title: MTLRenderPipelineDescriptor
framework: metal
role: symbol
role_heading: Class
path: metal/mtlrenderpipelinedescriptor
---

# MTLRenderPipelineDescriptor

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

## Declaration

```swift
class MTLRenderPipelineDescriptor
```

## Mentioned in

Compiling binary archives from a custom configuration script Creating binary archives from device-built pipeline state objects Improving rendering performance with vertex amplification Rendering to multiple texture slices in a draw command

## Overview

Overview An 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 object. Then configure and use the descriptor to create an MTLRenderPipelineState object. To specify the vertex or fragment function in the rendering pipeline descriptor, set the vertexFunction or fragmentFunction property, respectively, to the desired MTLFunction object. The system ignores the tessellation stage properties if you don’t set the 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 for more information. Setting the 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 property to an 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 type color texture), you can create multiple samples per fragment, and the following rendering pipeline descriptor properties determine coverage: rasterSampleCount is the number of samples for each pixel. If isAlphaToCoverageEnabled is true, the GPU uses the alpha channel fragment output for colorAttachments to compute a coverage mask that affects the values the GPU writes to all attachments (color, depth, and stencil). If isAlphaToOneEnabled is true, the GPU changes alpha channel fragment values for colorAttachments to 1.0, which is the largest representable value. If isAlphaToCoverageEnabled is true, an implementation-defined coverageToMask function uses the alpha channel fragment output from 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: if (alphaToCoverageEnabled) then     alphaCoverageMask = coverageToMask(colorAttachment0.alpha);

finalCoverageMask = originalRasterizerCoverageMask                     & alphaCoverageMask                     & fragShaderSampleMaskOutput;

## Topics

### Identifying the render pipeline state object

- [label](metal/mtlrenderpipelinedescriptor/label.md)

### Specifying graphics functions and associated data

- [vertexFunction](metal/mtlrenderpipelinedescriptor/vertexfunction.md)
- [fragmentFunction](metal/mtlrenderpipelinedescriptor/fragmentfunction.md)
- [maxVertexCallStackDepth](metal/mtlrenderpipelinedescriptor/maxvertexcallstackdepth.md)
- [maxFragmentCallStackDepth](metal/mtlrenderpipelinedescriptor/maxfragmentcallstackdepth.md)

### Specifying buffer layouts and fetch behavior

- [vertexDescriptor](metal/mtlrenderpipelinedescriptor/vertexdescriptor.md)

### Specifying buffer mutability

- [vertexBuffers](metal/mtlrenderpipelinedescriptor/vertexbuffers.md)
- [fragmentBuffers](metal/mtlrenderpipelinedescriptor/fragmentbuffers.md)

### Specifying rendering pipeline state

- [reset()](metal/mtlrenderpipelinedescriptor/reset().md)
- [colorAttachments](metal/mtlrenderpipelinedescriptor/colorattachments.md)
- [depthAttachmentPixelFormat](metal/mtlrenderpipelinedescriptor/depthattachmentpixelformat.md)
- [stencilAttachmentPixelFormat](metal/mtlrenderpipelinedescriptor/stencilattachmentpixelformat.md)

### Specifying rasterization and visibility state

- [isAlphaToCoverageEnabled](metal/mtlrenderpipelinedescriptor/isalphatocoverageenabled.md)
- [isAlphaToOneEnabled](metal/mtlrenderpipelinedescriptor/isalphatooneenabled.md)
- [isRasterizationEnabled](metal/mtlrenderpipelinedescriptor/israsterizationenabled.md)
- [inputPrimitiveTopology](metal/mtlrenderpipelinedescriptor/inputprimitivetopology.md)
- [rasterSampleCount](metal/mtlrenderpipelinedescriptor/rastersamplecount.md)
- [MTLPrimitiveTopologyClass](metal/mtlprimitivetopologyclass.md)
- [sampleCount](metal/mtlrenderpipelinedescriptor/samplecount.md)

### Specifying tessellation state

- [maxTessellationFactor](metal/mtlrenderpipelinedescriptor/maxtessellationfactor.md)
- [isTessellationFactorScaleEnabled](metal/mtlrenderpipelinedescriptor/istessellationfactorscaleenabled.md)
- [tessellationFactorFormat](metal/mtlrenderpipelinedescriptor/tessellationfactorformat.md)
- [tessellationControlPointIndexType](metal/mtlrenderpipelinedescriptor/tessellationcontrolpointindextype.md)
- [tessellationFactorStepFunction](metal/mtlrenderpipelinedescriptor/tessellationfactorstepfunction.md)
- [tessellationOutputWindingOrder](metal/mtlrenderpipelinedescriptor/tessellationoutputwindingorder.md)
- [tessellationPartitionMode](metal/mtlrenderpipelinedescriptor/tessellationpartitionmode.md)
- [MTLTessellationFactorFormat](metal/mtltessellationfactorformat.md)
- [MTLTessellationControlPointIndexType](metal/mtltessellationcontrolpointindextype.md)
- [MTLTessellationFactorStepFunction](metal/mtltessellationfactorstepfunction.md)
- [MTLTessellationPartitionMode](metal/mtltessellationpartitionmode.md)

### Specifying indirect command buffers usage

- [supportIndirectCommandBuffers](metal/mtlrenderpipelinedescriptor/supportindirectcommandbuffers.md)

### Specifying the maximum vertex amplification count

- [maxVertexAmplificationCount](metal/mtlrenderpipelinedescriptor/maxvertexamplificationcount.md)

### Specifying precompiled shader binaries

- [supportAddingVertexBinaryFunctions](metal/mtlrenderpipelinedescriptor/supportaddingvertexbinaryfunctions.md)
- [supportAddingFragmentBinaryFunctions](metal/mtlrenderpipelinedescriptor/supportaddingfragmentbinaryfunctions.md)
- [binaryArchives](metal/mtlrenderpipelinedescriptor/binaryarchives.md)

### Specifying callable functions for the pipeline

- [vertexLinkedFunctions](metal/mtlrenderpipelinedescriptor/vertexlinkedfunctions.md)
- [fragmentLinkedFunctions](metal/mtlrenderpipelinedescriptor/fragmentlinkedfunctions.md)

### Specifying shader validation

- [shaderValidation](metal/mtlrenderpipelinedescriptor/shadervalidation.md)

### Instance Properties

- [fragmentPreloadedLibraries](metal/mtlrenderpipelinedescriptor/fragmentpreloadedlibraries.md)
- [vertexPreloadedLibraries](metal/mtlrenderpipelinedescriptor/vertexpreloadedlibraries.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Render pipeline states

- [MTLRenderPipelineState](metal/mtlrenderpipelinestate.md)
- [MTL4RenderPipelineDescriptor](metal/mtl4renderpipelinedescriptor.md)
- [MTLRenderPipelineFunctionsDescriptor](metal/mtlrenderpipelinefunctionsdescriptor.md)
- [MTL4MeshRenderPipelineDescriptor](metal/mtl4meshrenderpipelinedescriptor.md)
- [MTLMeshRenderPipelineDescriptor](metal/mtlmeshrenderpipelinedescriptor.md)
- [MTLPipelineBufferDescriptor](metal/mtlpipelinebufferdescriptor.md)
- [MTLPipelineBufferDescriptorArray](metal/mtlpipelinebufferdescriptorarray.md)
- [MTL4RenderPipelineColorAttachmentDescriptor](metal/mtl4renderpipelinecolorattachmentdescriptor.md)
- [MTLRenderPipelineColorAttachmentDescriptor](metal/mtlrenderpipelinecolorattachmentdescriptor.md)
- [MTLRenderPipelineColorAttachmentDescriptorArray](metal/mtlrenderpipelinecolorattachmentdescriptorarray.md)
- [MTL4TileRenderPipelineDescriptor](metal/mtl4tilerenderpipelinedescriptor.md)
- [MTLTileRenderPipelineDescriptor](metal/mtltilerenderpipelinedescriptor.md)
- [MTLTileRenderPipelineColorAttachmentDescriptor](metal/mtltilerenderpipelinecolorattachmentdescriptor.md)
- [MTLPipelineOption](metal/mtlpipelineoption.md)
- [MTL4RenderPipelineBinaryFunctionsDescriptor](metal/mtl4renderpipelinebinaryfunctionsdescriptor.md)
