# AttachmentDescriptor

> A declaration of a single color or depth rendering surface to be attached into a RenderPass.

## Definition

* **Type:** Struct
* **Namespace:** [UnityEngine.Rendering](/engine/6000.0/script-reference/unityengine/rendering.md)
* **Assembly:** UnityEngine.CoreModule
* **Implements:** [IEquatable\<AttachmentDescriptor>](https://learn.microsoft.com/dotnet/api/system.iequatable-1)

```csharp
public struct AttachmentDescriptor : IEquatable<AttachmentDescriptor>
```

## Remarks

A AttachmentDescriptor object identifies a single color or depth rendering surface that can be used with a RenderPass. Note that the AttachmentDescriptor object derives from UnityEngine.Object so they do not get garbage collected like normal C# objects. Instead, they are only GC'd when unloading a Scene or when Resources.UnloadUnusedAssets() is called. Therefore do not create these objects each frame: Instead, create these objects in the constructor of your rendering class, and reuse those objects each frame.

## Constructors

| Constructor                                                                                                                                                                                                                                                                                                             | Description                                               |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| [AttachmentDescriptor(UnityEngine.Experimental.Rendering.GraphicsFormat)](/engine/6000.0/script-reference/unityengine/rendering/attachmentdescriptor/ctor.md#attachmentdescriptor\(graphicsformat\))                                                                                                                    | Create a AttachmentDescriptor to be used with RenderPass. |
| [AttachmentDescriptor(UnityEngine.RenderTextureFormat)](/engine/6000.0/script-reference/unityengine/rendering/attachmentdescriptor/ctor.md#attachmentdescriptor\(rendertextureformat\))                                                                                                                                 | Create a AttachmentDescriptor to be used with RenderPass. |
| [AttachmentDescriptor(UnityEngine.RenderTextureFormat,UnityEngine.Rendering.RenderTargetIdentifier,System.Boolean,System.Boolean,System.Boolean)](/engine/6000.0/script-reference/unityengine/rendering/attachmentdescriptor/ctor.md#attachmentdescriptor\(rendertextureformat-rendertargetidentifier-bool-bool-bool\)) | Create a AttachmentDescriptor to be used with RenderPass. |

## Properties

| Property                                                                                                         | Description                                                                                                                                                                                                                                                                                                                                                                                                |
| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [clearColor](/engine/6000.0/script-reference/unityengine/rendering/attachmentdescriptor/clearcolor.md)           | The currently assigned clear color for this attachment. Default is black.                                                                                                                                                                                                                                                                                                                                  |
| [clearDepth](/engine/6000.0/script-reference/unityengine/rendering/attachmentdescriptor/cleardepth.md)           | Currently assigned depth clear value for this attachment. Default value is 1.0.                                                                                                                                                                                                                                                                                                                            |
| [clearStencil](/engine/6000.0/script-reference/unityengine/rendering/attachmentdescriptor/clearstencil.md)       | Currently assigned stencil clear value for this attachment. Default is 0.                                                                                                                                                                                                                                                                                                                                  |
| [format](/engine/6000.0/script-reference/unityengine/rendering/attachmentdescriptor/format.md)                   | The format of this attachment.                                                                                                                                                                                                                                                                                                                                                                             |
| [graphicsFormat](/engine/6000.0/script-reference/unityengine/rendering/attachmentdescriptor/graphicsformat.md)   | The GraphicsFormat of this attachment. To use in place of format.                                                                                                                                                                                                                                                                                                                                          |
| [loadAction](/engine/6000.0/script-reference/unityengine/rendering/attachmentdescriptor/loadaction.md)           | The load action to be used on this attachment when the RenderPass starts.                                                                                                                                                                                                                                                                                                                                  |
| [loadStoreTarget](/engine/6000.0/script-reference/unityengine/rendering/attachmentdescriptor/loadstoretarget.md) | The surface to use as the backing storage for this AttachmentDescriptor.                                                                                                                                                                                                                                                                                                                                   |
| [resolveTarget](/engine/6000.0/script-reference/unityengine/rendering/attachmentdescriptor/resolvetarget.md)     | When the renderpass that uses this attachment ends, resolve the MSAA surface into the given target.                                                                                                                                                                                                                                                                                                        |
| [storeAction](/engine/6000.0/script-reference/unityengine/rendering/attachmentdescriptor/storeaction.md)         | The store action to use with this attachment when the RenderPass ends. Only used when either [AttachmentDescriptor.ConfigureTarget](/engine/6000.0/script-reference/unityengine/rendering/attachmentdescriptor/configuretarget.md) or [AttachmentDescriptor.ConfigureResolveTarget](/engine/6000.0/script-reference/unityengine/rendering/attachmentdescriptor/configureresolvetarget.md) has been called. |

## Methods

| Method                                                                                                                         | Description                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [ConfigureClear](/engine/6000.0/script-reference/unityengine/rendering/attachmentdescriptor/configureclear.md)                 | When the RenderPass starts, clear this attachment into the color or depth/stencil values given (depending on the format of this attachment). Changes [AttachmentDescriptor.loadAction](/engine/6000.0/script-reference/unityengine/rendering/attachmentdescriptor/loadaction.md) to [RenderBufferLoadAction.Clear](/engine/6000.0/script-reference/unityengine/rendering/renderbufferloadaction/clear.md). |
| [ConfigureResolveTarget](/engine/6000.0/script-reference/unityengine/rendering/attachmentdescriptor/configureresolvetarget.md) | When the renderpass that uses this attachment ends, resolve the MSAA surface into the given target.                                                                                                                                                                                                                                                                                                        |
| [ConfigureTarget](/engine/6000.0/script-reference/unityengine/rendering/attachmentdescriptor/configuretarget.md)               | Binds this AttachmentDescriptor to the given target surface.                                                                                                                                                                                                                                                                                                                                               |
