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

# MTLRenderPassAttachmentDescriptor

A render target that serves as the output destination for pixels generated by a render pass.

```
class MTLRenderPassAttachmentDescriptor
```

## Overview

Use an [`MTLRenderPassAttachmentDescriptor`](/documentation/Metal/MTLRenderPassAttachmentDescriptor) instance to configure an individual render target of a framebuffer. Each [`MTLRenderPassAttachmentDescriptor`](/documentation/Metal/MTLRenderPassAttachmentDescriptor) instance specifies one texture that a graphics rendering pass can write into.

Typically, you don’t directly create [`MTLRenderPassAttachmentDescriptor`](/documentation/Metal/MTLRenderPassAttachmentDescriptor) instances. Instead, the [`MTLRenderPassDescriptor`](/documentation/Metal/MTLRenderPassDescriptor) instance creates a default set of attachment instances. For each attachment that you intend to use as a render target, retrieve the [`MTLRenderPassAttachmentDescriptor`](/documentation/Metal/MTLRenderPassAttachmentDescriptor) instance from the render pass descriptor and configure its properties for use during this rendering pass.

You need to set the attachment’s [`texture`](/documentation/Metal/MTLRenderPassAttachmentDescriptor/texture) property. The [`level`](/documentation/Metal/MTLRenderPassAttachmentDescriptor/level), [`slice`](/documentation/Metal/MTLRenderPassAttachmentDescriptor/slice), and [`depthPlane`](/documentation/Metal/MTLRenderPassAttachmentDescriptor/depthPlane) properties specify the mipmap level, slice, and depth plane (for 3D textures) of the texture, respectively.

The [`loadAction`](/documentation/Metal/MTLRenderPassAttachmentDescriptor/loadAction) and [`storeAction`](/documentation/Metal/MTLRenderPassAttachmentDescriptor/storeAction) properties specify actions to perform at the start and end of a rendering pass for the attachment, respectively. For example, if you set the [`loadAction`](/documentation/Metal/MTLRenderPassAttachmentDescriptor/loadAction) property of an attachment to [`MTLLoadAction.clear`](/documentation/Metal/MTLLoadAction/clear), then the contents of the texture fill with a value for the type of attachment at the start of the rendering pass.

There are specific [`MTLRenderPassAttachmentDescriptor`](/documentation/Metal/MTLRenderPassAttachmentDescriptor) subclasses for color, depth, and stencil attachments. Each subclass provides additional properties to configure for that kind of attachment. The table below provides the list of subclasses.

|Attachment type|Descriptor subclass                                                                   |
|---------------|--------------------------------------------------------------------------------------|
|Color          |``doc://com.apple.metal/documentation/Metal/MTLRenderPassColorAttachmentDescriptor``  |
|Depth          |``doc://com.apple.metal/documentation/Metal/MTLRenderPassDepthAttachmentDescriptor``  |
|Stencil        |``doc://com.apple.metal/documentation/Metal/MTLRenderPassStencilAttachmentDescriptor``|

### Multisampling

To perform multisampled antialiased rendering, you use two textures. Attach to the [`texture`](/documentation/Metal/MTLRenderPassAttachmentDescriptor/texture) property a [`MTLTextureType.type2DMultisample`](/documentation/Metal/MTLTextureType/type2DMultisample) texture, and a 2D or cube texture to the [`resolveTexture`](/documentation/Metal/MTLRenderPassAttachmentDescriptor/resolveTexture) property. When a rendering command executes, it renders to the multisample texture. At the end of the render pass, the GPU resolves the contents of the multisample texture and writes the results into the resolve texture. The [`resolveLevel`](/documentation/Metal/MTLRenderPassAttachmentDescriptor/resolveLevel), [`resolveSlice`](/documentation/Metal/MTLRenderPassAttachmentDescriptor/resolveSlice), and [`resolveDepthPlane`](/documentation/Metal/MTLRenderPassAttachmentDescriptor/resolveDepthPlane) properties specify where the resolved image is written to. The attachment’s [`storeAction`](/documentation/Metal/MTLRenderPassAttachmentDescriptor/storeAction) property determines what happens to the multisample texture after the GPU resolves its data.

## Topics

### Specifying the texture for the attachment

[`texture`](/documentation/Metal/MTLRenderPassAttachmentDescriptor/texture)

The texture object associated with this attachment.

[`level`](/documentation/Metal/MTLRenderPassAttachmentDescriptor/level)

The mipmap level of the texture used for rendering to the attachment.

[`slice`](/documentation/Metal/MTLRenderPassAttachmentDescriptor/slice)

The slice of the texture used for rendering to the attachment.

[`depthPlane`](/documentation/Metal/MTLRenderPassAttachmentDescriptor/depthPlane)

The depth plane of the texture used for rendering to the attachment.

### Specifying rendering pass actions

[`loadAction`](/documentation/Metal/MTLRenderPassAttachmentDescriptor/loadAction)

The action performed by this attachment at the start of a rendering pass for a render command encoder.

[`storeAction`](/documentation/Metal/MTLRenderPassAttachmentDescriptor/storeAction)

The action performed by this attachment at the end of a rendering pass for a render command encoder.

[`storeActionOptions`](/documentation/Metal/MTLRenderPassAttachmentDescriptor/storeActionOptions)

The options that modify the store action performed by this attachment.

### Specifying the texture to resolve multisample data

[`resolveTexture`](/documentation/Metal/MTLRenderPassAttachmentDescriptor/resolveTexture)

The destination texture used when resolving multisampled texture data into single sample values.

[`resolveLevel`](/documentation/Metal/MTLRenderPassAttachmentDescriptor/resolveLevel)

The mipmap level of the texture used for the multisample resolve action.

[`resolveSlice`](/documentation/Metal/MTLRenderPassAttachmentDescriptor/resolveSlice)

The slice of the texture used for the multisample resolve action.

[`resolveDepthPlane`](/documentation/Metal/MTLRenderPassAttachmentDescriptor/resolveDepthPlane)

The depth plane of the texture used for the multisample resolve action.



---

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)