Contents

executeCommandsInBuffer(_:indirectBuffer:offset:)

Encodes a command that runs an indirect range of commands from an indirect command buffer (ICB).

Declaration

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

Parameters

  • buffer:

    An Mtlindirectcommandbuffer instance that contains other commands the current command runs.

  • 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:

    An integer that represents the location, in bytes, from the start of indirectRangeBuffer where the execution range structure begins.

    See the Metal Feature Set Tables to check for offset alignment requirements for buffers in device and constant address space.

See Also

Running commands from indirect command buffers