Instance Method

encodeWaitForEvent(_:value:)

Encodes a command that blocks the execution of the command buffer until the given event reaches the given value.

Required.

Declaration

func encodeWaitForEvent(_ event: MTLEvent, value: UInt64)

Parameters

event

The event on which to wait.

value

The minimum value the event must have before the GPU executes commands that follow this command.

Discussion

You can't encode a wait event if the command buffer has an active command encoder.

When the device object reaches the command for the wait event, the device object waits until the event is signaled with a value equal to or larger than the provided value. While waiting, the GPU executes commands that appear earlier than the wait command, but doesn't start any commands that appear after it. Execution continues immediately if the event already has an equal or larger value.

See Also

Synchronizing Events

func encodeSignalEvent(MTLEvent, value: UInt64)

Encodes a command that signals the given event, updating it to a new value.

Required.