Instance Method

updateFence:

Tells the GPU to update the fence after all commands encoded by the compute command encoder have finished executing.

Required.

Declaration

- (void)updateFence:(id<MTLFence>)fence;

Parameters

fence

The fence to update.

Discussion

Fences are manipulated when the command buffer is submitted to the hardware. 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

Synchronizing Command Execution for Untracked Resources

- waitForFence:

Tells the GPU to wait until the fence is updated before executing any commands encoded by the compute command encoder.

Required.