Instance Method

textureBarrier

Ensures that any texture reads issued after the barrier can safely read from any rendering to those textures performed before the barrier.

Required.

Declaration

- (void)textureBarrier;

Discussion

If a same texture is the rendering destination in a render pass and is also read from a shader, the results of the texture reads are undefined unless texture barriers are used.

A texture barrier enables your app to safely write to and read from the same texture, with predictable results. The barrier ensures that any texture write operations of draw calls before the barrier are completed before any texture read operations of draw calls after the barrier are started.

See Also

Synchronizing Command Execution for Untracked Resources

- updateFence:afterStages:

Updates the given fence to capture all GPU work enqueued by the command encoder up to the given render stage.

Required.

- waitForFence:beforeStages:

Prevents further GPU work to be enqueued by the command encoder until the given fence is reached for the given render stage.

Required.

- memoryBarrierWithScope:afterStages:beforeStages:

Encodes a barrier so that data written to memory by commands encoded before the barrier is available to commands encoded after the barrier.

Required.

MTLRenderStages

The render stages at which a synchronization command is triggered.

MTLBarrierScope

Describes the types of resources that a barrier operates on.