Instance Method

encodeSignalEvent(_:value:)

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

Required.

Declaration

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

Parameters

event

The event you want to signal.

value

The new value for the event.

Discussion

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

Metal signals the event after all commands scheduled prior to this command have finished executing. If the new event value is greater than the event's current value, Metal updates the event's value to the new value. Commands waiting on the event are allowed to run if the new value is equal to or greater than the value for which they are waiting. For shared events, this update similarly triggers notification handlers waiting on the event.

See Also

Synchronizing Events

func encodeWaitForEvent(MTLEvent, value: UInt64)

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

Required.