Protocol

MTLIndirectCommandBuffer

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

Declaration

protocol MTLIndirectCommandBuffer

Overview

Use an indirect command buffer to encode commands once and reuse them, and to encode commands on multiple CPU or GPU threads.

Don’t implement this protocol yourself; instead, create a MTLIndirectCommandBufferDescriptor object, configure its properties, and tell the MTLDevice to create the indirect command buffer. See Creating an Indirect Command Buffer.

Topics

Determining the Maximum Number of Commands

var size: Int

The number of commands contained in the indirect command buffer.

Required.

Retrieving Commands

func indirectRenderCommandAt(Int) -> MTLIndirectRenderCommand

Gets the render command at the given index.

Required.

func indirectComputeCommand(at: Int) -> MTLIndirectComputeCommand

Gets the compute command at the given index.

Required.

Resetting Commands

func reset(Range<Int>)

Resets a range of commands to their default state.

Relationships

Inherits From

See Also

Essentials

Creating an Indirect Command Buffer

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

protocol MTLIndirectRenderCommand

A render command in an indirect command buffer.

protocol MTLIndirectComputeCommand

A compute command in an indirect command buffer.

struct MTLIndirectCommandBufferExecutionRange

A range of commands in an indirect command buffer.