Contents

executeCommandsInBuffer(_:indirectBuffer:offset:)

Encodes an instruction to run commands from an indirect buffer, using another buffer to provide the command range.

Declaration

func executeCommandsInBuffer(_ buffer: any MTLIndirectCommandBuffer, indirectBuffer indirectRangeBuffer: any MTLBuffer, offset: Int)

Parameters

  • buffer:

    The Mtlindirectcommandbuffer instance containing the commands to execute.

  • indirectRangeBuffer:

    An Mtlbuffer instance with data that matches the layout of the Mtlindirectcommandbufferexecutionrange structure.

    When running on Metal devices that belong to the Mac2 GPU family, the maximum value for the Length property of that structure is 0x4000 (16,384). Metal devices that belong to an Apple silicon family, such as Apple10, don’t have this limitation.

  • offset:

    The number of bytes from the start of indirectRangeBuffer containing the execution range to use. Align the offset on a multiple of 4.

See Also

Dispatching from indirect command buffers