<!--
{
  "availability" : [
    "iOS: 12.0.0 -",
    "iPadOS: 12.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.14.0 -",
    "tvOS: 12.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLRenderCommandEncoder/executeCommandsInBuffer:withRange:",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLRenderCommandEncoder(im)executeCommandsInBuffer:withRange:"
  },
  "title" : "executeCommandsInBuffer:withRange:"
}
-->

# executeCommandsInBuffer:withRange:

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

```
- (void) executeCommandsInBuffer:(id<MTLIndirectCommandBuffer>) indirectCommandBuffer withRange:(NSRange) executionRange;
```

## Parameters

`indirectCommandBuffer`

An [`MTLIndirectCommandBuffer`](/documentation/Metal/MTLIndirectCommandBuffer) instance that contains other commands the current command runs.

`executionRange`

A span of integers that represent the command entries in `buffer` the current command runs. The number of commands needs to be less than or equal to `0x4000` (`16,384`).

---

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)