<!--
{
  "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:with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "s:So24MTLComputeCommandEncoderP5MetalE15executeCommands2in4withySo011MTLIndirectB6Buffer_p_So8_NSRangeVtF"
  },
  "title" : "executeCommands(in:with:)"
}
-->

# executeCommands(in:with:)

Encodes an instruction to run commands from an indirect buffer.

```
func executeCommands(in indirectCommandBuffer: any MTLIndirectCommandBuffer, with executionRange: NSRange)
```

## Parameters

`indirectCommandBuffer`

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

`executionRange`

The range of commands to execute. The maximum length of the range is `16384` commands.

---

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)