---
title: "setIndirectCommandBuffers(_:range:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlargumentencoder/setindirectcommandbuffers(_:range:)"
---

# setIndirectCommandBuffers(_:range:)

Encodes an array of indirect command buffers into the argument buffer.

## Declaration

```swift
func setIndirectCommandBuffers(_ buffers: [(any MTLIndirectCommandBuffer)?], range: Range<Int>)
```

## Parameters

- `buffers`: An array of indirect command buffers the method encodes.
- `range`: A range of indices within the argument buffer for each element in buffers. The values correspond to either the index IDs of declarations in Metal Shading Language (MSL) or the doc://com.apple.metal/documentation/Metal/MTLArgumentDescriptor/index property of doc://com.apple.metal/documentation/Metal/MTLArgumentDescriptor instances.

## See Also

### Encoding indirect command buffers

- [setIndirectCommandBuffer(_:index:)](metal/mtlargumentencoder/setindirectcommandbuffer(_:index:).md)
