Registers a block of code that Metal calls immediately after the GPU finishes executing the commands in the command buffer.
- iOS 8.0+
- macOS 10.11+
- Mac Catalyst 13.0+
- tvOS 9.0+
A block of code to be invoked.
You can register multiple handlers for the same command buffer. You can’t add a completion handler after you commit the command buffer.
The buffer calls the completion handlers after it finishes execution. Check the
status property to determine whether execution was successful or had errors.
Listing 1 demonstrates how to use the
gpuStartTime properties to determine how long it took the GPU to execute the command buffer.
Scheduling and Executing Commands
Reserves a place for the command buffer on the associated command queue.