---
title: "executeCommands(buffer:range:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtl4rendercommandencoder/executecommands(buffer:range:)"
---

# executeCommands(buffer:range:)

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

## Declaration

```swift
func executeCommands(buffer: any MTLIndirectCommandBuffer, range: Range<Int>)
```

## Parameters

- `buffer`: An doc://com.apple.metal/documentation/Metal/MTLIndirectCommandBuffer instance that contains other commands the current command runs.
- `range`: 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 16,384.

## See Also

### Running commands from indirect command buffers

- [executeCommands(buffer:indirectBuffer:)](metal/mtl4rendercommandencoder/executecommands(buffer:indirectbuffer:).md)
