---
title: "setVertexBuffers(_:offsets:range:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlrendercommandencoder/setvertexbuffers(_:offsets:range:)"
---

# setVertexBuffers(_:offsets:range:)

Assigns multiple buffers to a range of entries in the vertex shader argument table.

## Declaration

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

## Parameters

- `buffers`: An array of doc://com.apple.metal/documentation/Metal/MTLBuffer instances the command assigns to entries in the vertex shader argument table for buffers.
- `offsets`: An array of integers. Each element represents the location, in bytes, from the start of the corresponding doc://com.apple.metal/documentation/Metal/MTLBuffer element in buffers where the vertex shader argument data 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.
- `range`: A span of integers that represent the entries in the vertex shader argument table for buffers. Each entry stores a record of the corresponding element in buffers and offsets.

## Discussion

Discussion By default, the buffer at each index is nil. note: The Objective-C version of this method is setVertexBuffers:offsets:withRange:.

## See Also

### Assigning buffers

- [setVertexBuffer(_:offset:index:)](metal/mtlrendercommandencoder/setvertexbuffer(_:offset:index:).md)
- [setVertexBuffer(_:offset:attributeStride:index:)](metal/mtlrendercommandencoder/setvertexbuffer(_:offset:attributestride:index:).md)
- [setVertexBuffers(_:offsets:attributeStrides:range:)](metal/mtlrendercommandencoder/setvertexbuffers(_:offsets:attributestrides:range:).md)
- [setVertexBytes(_:length:index:)](metal/mtlrendercommandencoder/setvertexbytes(_:length:index:).md)
- [setVertexBytes(_:length:attributeStride:index:)](metal/mtlrendercommandencoder/setvertexbytes(_:length:attributestride:index:).md)
- [setVertexBufferOffset(_:index:)](metal/mtlrendercommandencoder/setvertexbufferoffset(_:index:).md)
- [setVertexBufferOffset(offset:attributeStride:index:)](metal/mtlrendercommandencoder/setvertexbufferoffset(offset:attributestride:index:).md)
