Instance Method

updateFence(_:)

Updates the given fence to capture all GPU work enqueued by the command encoder up to this specific point.

Required.

Declaration

func updateFence(_ fence: MTLFence)

Parameters

fence

The fence to update.

Discussion

Fences are manipulated when the command buffer is submitted to the GPU. This maintains global order and prevents deadlock.

Fences are evaluated at command encoder boundaries. Waits occur at the beginning of an encoder and updates occur at the end of the encoder. Therefore, you’re not allowed to first update and then wait on the same fence in the same encoder. However, you’re allowed to first wait and then update the same fence.

See Also

Performing Fence Operations

func waitForFence(MTLFence)

Prevents further GPU commands from being enqueued by the command encoder until the given fence is reached.

Required.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software