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

# loadAction

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

```
var loadAction: MTLLoadAction { get set }
```

## Discussion

If your app renders all pixels of the render target for a given frame, use the [`MTLLoadAction.dontCare`](/documentation/Metal/MTLLoadAction/dontCare) action, which allows the GPU to avoid loading the existing contents of the texture. Otherwise, use the [`MTLLoadAction.clear`](/documentation/Metal/MTLLoadAction/clear) action to clear the previous contents of the render target or the [`MTLLoadAction.load`](/documentation/Metal/MTLLoadAction/load) action to preserve them. The [`MTLLoadAction.clear`](/documentation/Metal/MTLLoadAction/clear) action also avoids the cost of loading the existing texture contents, but it still incurs the cost of filling the destination with a clear color.

For color render targets, the default value is [`MTLLoadAction.dontCare`](/documentation/Metal/MTLLoadAction/dontCare). For depth or stencil render targets, the default value is [`MTLLoadAction.clear`](/documentation/Metal/MTLLoadAction/clear).

---

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)