---
title: "executeCommandsInBuffer:withRange:"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlrendercommandencoder/executecommandsinbuffer:withrange:"
---

# executeCommandsInBuffer:withRange:

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

## Declaration

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

## Parameters

- `indirectCommandBuffer`: An doc://com.apple.metal/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).

## See Also

### Running commands from indirect command buffers

- [executeCommandsInBuffer:indirectBuffer:indirectBufferOffset:](metal/mtlrendercommandencoder/executecommandsinbuffer:indirectbuffer:indirectbufferoffset:.md)
