loadAction
The action performed by this attachment at the start of a rendering pass for a render command encoder.
Declaration
var loadAction: MTLLoadAction { get set }Mentioned in
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.