---
title: "setBuffers(_:offsets:range:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlargumentencoder/setbuffers(_:offsets:range:)"
---

# setBuffers(_:offsets:range:)

Encodes references to an array of buffers into the argument buffer.

## Declaration

```swift
func setBuffers(_ buffers: [(any MTLBuffer)?], offsets: [Int], range: Range<Int>)
```

## Parameters

- `buffers`: An array of buffers the method encodes.
- `offsets`: An array of byte offsets for each element in buffers.
- `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 buffers

- [setBuffer(_:offset:index:)](metal/mtlargumentencoder/setbuffer(_:offset:index:).md)
