---
title: loadAction
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtlrenderpassattachmentdescriptor/loadaction
---

# loadAction

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

## Declaration

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

## Mentioned in

Setting load and store actions

## Discussion

Discussion If your app renders all pixels of the render target for a given frame, use the MTLLoadAction.dontCare action, which allows the GPU to avoid loading the existing contents of the texture. Otherwise, use the MTLLoadAction.clear action to clear the previous contents of the render target or the MTLLoadAction.load action to preserve them. The 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. For depth or stencil render targets, the default value is MTLLoadAction.clear.

## See Also

### Specifying rendering pass actions

- [storeAction](metal/mtlrenderpassattachmentdescriptor/storeaction.md)
- [storeActionOptions](metal/mtlrenderpassattachmentdescriptor/storeactionoptions.md)
