Type Alias

MTLCommandBufferHandler

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

Declaration

typedef void (^MTLCommandBufferHandler)(id<MTLCommandBuffer>);

Discussion

The completion handler takes the following parameters:

buffer

The command buffer that was scheduled or completed.

See Also

Scheduling and Executing Commands

- enqueue

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

Required.

- commit

Commits the command buffer for execution.

Required.

- addScheduledHandler:

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

Required.

- addCompletedHandler:

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

Required.

- waitUntilScheduled

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

Required.

- waitUntilCompleted

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

Required.