Instance Method

waitUntilScheduled()

Blocks execution of the current thread until the command buffer is scheduled.

Required.

Declaration

func waitUntilScheduled()

Discussion

This method returns after the command buffer has been scheduled and all code blocks registered by addScheduledHandler(_:) have been invoked. A command buffer is considered scheduled after all its dependencies are resolved, and it is sent to the GPU for execution.

See Also

Scheduling and Executing Commands

func enqueue()

Reserves a place for the command buffer on the associated command queue.

Required.

func commit()

Commits the command buffer for execution.

Required.

func addScheduledHandler(MTLCommandBufferHandler)

Registers a block of code that Metal calls immediately after it schedules the command buffer for execution on the GPU.

Required.

func addCompletedHandler(MTLCommandBufferHandler)

Registers a block of code that Metal calls immediately after the GPU finishes executing the commands in the command buffer.

Required.

func waitUntilCompleted()

Blocks execution of the current thread until execution of the command buffer is completed.

Required.

typealias MTLCommandBufferHandler

A block of code invoked when a command buffer is scheduled for execution or has completed execution.