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

# executeCommandsInBuffer:indirectBuffer:indirectBufferOffset:

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

```
- (void) executeCommandsInBuffer:(id<MTLIndirectCommandBuffer>) indirectCommandbuffer indirectBuffer:(id<MTLBuffer>) indirectRangeBuffer indirectBufferOffset:(NSUInteger) indirectBufferOffset;
```

## Parameters

`indirectCommandbuffer`

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

`indirectRangeBuffer`

An [`MTLBuffer`](/documentation/Metal/MTLBuffer) instance with data that matches the layout of the [`MTLIndirectCommandBufferExecutionRange`](/documentation/Metal/MTLIndirectCommandBufferExecutionRange) structure.

    The [`length`](/documentation/Metal/MTLIndirectCommandBufferExecutionRange/length)     property of that structure needs to be less than or equal to     `0x4000`     (    `16,384`    ).

`indirectBufferOffset`

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 (PDF)](https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf)     to check for offset alignment requirements for buffers in     `device`     and     `constant`     address space.

## Discussion

---

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)