---
title: "executeCommandsInBuffer:indirectBuffer:indirectBufferOffset:"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlrendercommandencoder/executecommandsinbuffer:indirectbuffer:indirectbufferoffset:"
---

# executeCommandsInBuffer:indirectBuffer:indirectBufferOffset:

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

## Declaration

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

## Parameters

- `indirectCommandbuffer`: An doc://com.apple.metal/documentation/Metal/MTLIndirectCommandBuffer instance that contains other commands the current command runs.
- `indirectRangeBuffer`: An doc://com.apple.metal/documentation/Metal/MTLBuffer instance with data that matches the layout of the doc://com.apple.metal/documentation/Metal/MTLIndirectCommandBufferExecutionRange structure. The doc://com.apple.metal/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 https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf to check for offset alignment requirements for buffers in device and constant address space.

## See Also

### Running commands from indirect command buffers

- [executeCommandsInBuffer:withRange:](metal/mtlrendercommandencoder/executecommandsinbuffer:withrange:.md)
