<!--
{
  "availability" : [
    "iOS: 13.0.0 - 14.0.0",
    "iPadOS: 13.0.0 - 14.0.0",
    "tvOS: 13.0.0 - 14.0.0",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLComputeCommandEncoder/executeCommands(in:indirectBuffer:indirectBufferOffset:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "s:So24MTLComputeCommandEncoderP5MetalE15executeCommands2in14indirectBuffer0hI6OffsetySo011MTLIndirectbI0_p_So9MTLBuffer_pSitF"
  },
  "title" : "executeCommands(in:indirectBuffer:indirectBufferOffset:)"
}
-->

# executeCommands(in:indirectBuffer:indirectBufferOffset:)

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

```
func executeCommands(in indirectCommandbuffer: any MTLIndirectCommandBuffer, indirectBuffer indirectRangeBuffer: any MTLBuffer, indirectBufferOffset: Int)
```

## Parameters

`indirectCommandbuffer`

The [`MTLIndirectCommandBuffer`](/documentation/Metal/MTLIndirectCommandBuffer) instance containing the commands to execute.

`indirectRangeBuffer`

An indirect buffer containing the execution range, laid out in an [`MTLIndirectCommandBufferExecutionRange`](/documentation/Metal/MTLIndirectCommandBufferExecutionRange) instance. The maximum length of the range is `16384` commands.

`indirectBufferOffset`

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)