<!--
{
  "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/MTLRenderPassDescriptor",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(cs)MTLRenderPassDescriptor"
  },
  "title" : "MTLRenderPassDescriptor"
}
-->

# MTLRenderPassDescriptor

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

```
class MTLRenderPassDescriptor
```

## Overview

An [`MTLRenderPassDescriptor`](/documentation/Metal/MTLRenderPassDescriptor) instance contains a collection of attachments used as the rendering destination for pixels generated by a rendering pass. The [`MTLRenderPassDescriptor`](/documentation/Metal/MTLRenderPassDescriptor) instance also sets the destination buffer for visibility information generated by a rendering pass.

> Important:
> When configuring an ``doc://com.apple.metal/documentation/Metal/MTLTextureDescriptor`` instance for use with an attachment, set its ``doc://com.apple.metal/documentation/Metal/MTLTextureDescriptor/usage`` value to ``doc://com.apple.metal/documentation/Metal/MTLTextureUsage/renderTarget`` if you already know that you intend to use the resulting ``doc://com.apple.metal/documentation/Metal/MTLTexture`` instance in an attachment. This may significantly improve your app’s performance with certain hardware.

## Topics

### Creating a default render pass descriptor

[`renderPassDescriptor`](/documentation/Metal/MTLRenderPassDescriptor/renderPassDescriptor)

Creates a default render pass descriptor.

### Specifying the attachments for a rendering pass

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

An array of state information for attachments that store color data.

[`depthAttachment`](/documentation/Metal/MTLRenderPassDescriptor/depthAttachment)

State information for an attachment that stores depth data.

[`stencilAttachment`](/documentation/Metal/MTLRenderPassDescriptor/stencilAttachment)

State information for an attachment that stores stencil data.

### Specifying the visibility result buffer

[`visibilityResultBuffer`](/documentation/Metal/MTLRenderPassDescriptor/visibilityResultBuffer)

A buffer where the GPU writes visibility test results when fragments pass depth and stencil tests.

### Layered rendering

[`renderTargetArrayLength`](/documentation/Metal/MTLRenderPassDescriptor/renderTargetArrayLength)

The number of active layers that all attachments need to have for layered rendering.

[`renderTargetWidth`](/documentation/Metal/MTLRenderPassDescriptor/renderTargetWidth)

The width, in pixels, to constrain the render target to.

[`renderTargetHeight`](/documentation/Metal/MTLRenderPassDescriptor/renderTargetHeight)

The height, in pixels, to constrain the render target to.

### Using programmable sample positions

[`MTLSamplePositionMake(_:_:)`](/documentation/Metal/MTLSamplePositionMake(_:_:))

Returns a new sample position on a subpixel grid.

[`setSamplePositions(_:)`](/documentation/Metal/MTLRenderPassDescriptor/setSamplePositions(_:))

Sets the programmable sample positions for a render pass.

[`getSamplePositions()`](/documentation/Metal/MTLRenderPassDescriptor/getSamplePositions())

Returns the programmable sample positions set for a render pass.

[`setSamplePositions:count:`](/documentation/Metal/MTLRenderPassDescriptor/setSamplePositions:count:)

Sets the programmable sample positions for a render pass.

[`getSamplePositions:count:`](/documentation/Metal/MTLRenderPassDescriptor/getSamplePositions:count:)

Retrieves the programmable sample positions set for a render pass.

### Specifying tile shading parameters

[`imageblockSampleLength`](/documentation/Metal/MTLRenderPassDescriptor/imageblockSampleLength)

The per-sample size, in bytes, of the largest explicit imageblock layout in the render pass.

[`threadgroupMemoryLength`](/documentation/Metal/MTLRenderPassDescriptor/threadgroupMemoryLength)

The per-tile size, in bytes, of the persistent threadgroup memory allocation.

[`tileWidth`](/documentation/Metal/MTLRenderPassDescriptor/tileWidth)

The tile width, in pixels.

[`tileHeight`](/documentation/Metal/MTLRenderPassDescriptor/tileHeight)

The tile height, in pixels.

### Specifying sample counts

[`defaultRasterSampleCount`](/documentation/Metal/MTLRenderPassDescriptor/defaultRasterSampleCount)

The raster sample count for the render pass when the render pass doesn’t have explicit attachments.

### Specifying a rasterization rate map

[`rasterizationRateMap`](/documentation/Metal/MTLRenderPassDescriptor/rasterizationRateMap)

The rasterization rate map to use when executing the render pass.

### Specifying sample buffers for GPU counters

[`sampleBufferAttachments`](/documentation/Metal/MTLRenderPassDescriptor/sampleBufferAttachments)

The array of sample buffers that the render pass can access.



---

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)