Protocol

MTLIndirectRenderCommand

A render command in an indirect command buffer.

Declaration

@protocol MTLIndirectRenderCommand

Overview

Don’t implement this protocol; you get objects of this type by asking a MTLIndirectCommandBuffer for them.

Use this object to reset or encode a command. You must always reset a command before encoding a new command.

Topics

Setting Command Arguments

- setRenderPipelineState:

Sets the render pipeline state object used by the command.

Required.

- setVertexBuffer:offset:atIndex:

Sets a vertex buffer argument for the command.

Required.

- setFragmentBuffer:offset:atIndex:

Sets a fragment buffer argument for the command.

Required.

Encoding a Drawing Command

- drawPrimitives:vertexStart:vertexCount:instanceCount:baseInstance:

Encodes a command to render a number of instances of primitives using vertex data in contiguous array elements, starting from the base instance.

Required.

- drawIndexedPrimitives:indexCount:indexType:indexBuffer:indexBufferOffset:instanceCount:baseVertex:baseInstance:

Encodes a command to render a number of instances of primitives using an index list specified in a buffer, starting from the base vertex of the base instance.

Required.

Resetting a Command

- reset

Resets the command to its default state.

Required.

Relationships

Inherits From

See Also

Indirect Command Buffers

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.

MTLIndirectComputeCommand

A compute command in an indirect command buffer.

Beta
MTLIndirectCommandBufferExecutionRange

A range of commands in an indirect 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