Advanced Command Setup

Organize your commands for maximum concurrency and minimal dependencies.


Metal performs basic synchronization for you, but take full control of the work yourself for best performance.


Indirect Command Buffers

Recoup encoding time by reusing commands, or create a GPU-driven rendering pipeline by generating commands on the GPU.

Creating an Indirect Command Buffer

Configure a descriptor to specify the properties of an indirect command buffer.

Encoding Indirect Command Buffers on the CPU

Reduce CPU overhead and simplify your command execution by reusing commands.

Encoding Indirect Command Buffers on the GPU

Maximize CPU to GPU parallelization by generating render commands on the GPU.

Optimizing encoded commands

Improve the performance of commands encoded in an indirect command buffer.


A command buffer containing reusable commands, encoded either on the CPU or GPU.


An object that configures new MTLIndirectCommandBuffer objects.


A render command in an indirect command buffer.


A compute command in an indirect command buffer.


A range of commands in an indirect command buffer.

See Also

Command Setup

Setting Up a Command Structure

Discover how Metal executes commands on a GPU.

Devices and Commands

Demonstrates how to access and interact with the GPU.

Enhancing Frame Capture by Using Labels

Assign meaningful labels to your Metal objects and commands so you can easily identify them in the call list of a captured frame.


A queue that organizes command buffers to be executed by a GPU.


A container that stores encoded commands for the GPU to execute.


An encoder that writes GPU commands into a command buffer.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software