Instance Property

loadAction

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

Declaration

@property(nonatomic) MTLLoadAction loadAction;

Discussion

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

See Also

Specifying Rendering Pass Actions

storeAction

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

storeActionOptions

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