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

# setObjectBufferOffset(_:index:)

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

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

## Parameters

`offset`

An integer that represents the location, in bytes, from the start of `buffer` where the object 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 object 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 mesh buffer
that already has a previous assignment from one of your earlier commands.

For more information, see:

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

The command can also adjust the offset for an entry that you previously set with the
[`setObjectBytes(_:length:index:)`](/documentation/Metal/MTLRenderCommandEncoder/setObjectBytes(_: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.

---

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)