<!--
{
  "availability" : [
    "iOS: 8.3.0 -",
    "iPadOS: 8.3.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLRenderCommandEncoder/setVertexBufferOffset(_:index:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLRenderCommandEncoder(im)setVertexBufferOffset:atIndex:"
  },
  "title" : "setVertexBufferOffset(_:index:)"
}
-->

# setVertexBufferOffset(_:index:)

Updates an entry in the vertex shader argument table with a new location within the entry’s current buffer.

```
func setVertexBufferOffset(_ offset: Int, index: Int)
```

## Parameters

`offset`

An integer that represents the location, in bytes, from the start of `buffer` where the vertex shader argument data begins.

    See the     [Metal feature set tables (PDF)](https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf)     to check for offset alignment requirements for buffers in     `device`     and     `constant`     address space.

`index`

An integer that represents the entry in the vertex shader argument table for buffers that already stores a record of an [`MTLBuffer`](/documentation/Metal/MTLBuffer).

## Discussion

The command this method encodes changes the offset for a fragment buffer
that already has a previous assignment from one of your earlier commands.

For more information, see:

- [`setVertexBuffer(_:offset:index:)`](/documentation/Metal/MTLRenderCommandEncoder/setVertexBuffer(_:offset:index:))
- [`setVertexBuffers(_:offsets:range:)`](/documentation/Metal/MTLRenderCommandEncoder/setVertexBuffers(_:offsets:range:)) (Swift)
- [`setVertexBuffers:offsets:withRange:`](/documentation/Metal/MTLRenderCommandEncoder/setVertexBuffers:offsets:withRange:) (Objective-C)

The command can also adjust the offset for an entry that you previously set with the
[`setVertexBytes(_:length:index:)`](/documentation/Metal/MTLRenderCommandEncoder/setVertexBytes(_:length:index:)) method.

> Tip:
> If you’re only updating an offset, this method is typically more efficient than rebinding a buffer or byte block with the methods above.

By default, the buffer at each index is `nil`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)