---
title: "setMeshBufferOffset(_:index:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlrendercommandencoder/setmeshbufferoffset(_:index:)"
---

# setMeshBufferOffset(_:index:)

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

## Declaration

```swift
func setMeshBufferOffset(_ offset: Int, index: Int)
```

## Parameters

- `offset`: An integer that represents the location, in bytes, from the start of buffer where the mesh 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.
- `index`: An integer that represents the entry in the mesh shader argument table for buffers that already stores a record of an doc://com.apple.metal/documentation/Metal/MTLBuffer.

## Discussion

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: setMeshBuffer(_:offset:index:) setMeshBuffers(_:offsets:range:) (Swift) setMeshBuffers:offsets:withRange: (Objective-C) The command can also adjust the offset for an entry that you previously set with the setMeshBytes(_: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.

## See Also

### Assigning buffers for mesh shaders

- [setMeshBuffer(_:offset:index:)](metal/mtlrendercommandencoder/setmeshbuffer(_:offset:index:).md)
- [setMeshBuffers(_:offsets:range:)](metal/mtlrendercommandencoder/setmeshbuffers(_:offsets:range:).md)
- [setMeshBytes(_:length:index:)](metal/mtlrendercommandencoder/setmeshbytes(_:length:index:).md)
