Advanced Command Setup

Organize your commands for maximum concurrency and minimal dependencies.

Overview

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

Topics

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.

MTLIndirectCommandBuffer

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

MTLIndirectCommandBufferDescriptor

An object that configures new MTLIndirectCommandBuffer objects.

MTLIndirectRenderCommand

A render command in an indirect command buffer.

MTLIndirectComputeCommand

A compute command in an indirect command buffer.

Beta
MTLIndirectCommandBufferExecutionRange

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.

MTLCommandQueue

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

MTLCommandBuffer

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

MTLCommandEncoder

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