---
title: "setVertices(_:offset:semantic:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/lowleveldeformation/mesh/setvertices(_:offset:semantic:)"
---

# setVertices(_:offset:semantic:)

Binds a Metal buffer to the vertex attribute with the specified semantic.

## Declaration

```swift
func setVertices(_ buffer: any MTLBuffer, offset: Int, semantic: LowLevelDeformation.VertexSemantic) throws(LowLevelDeformation.Error)
```

## Parameters

- `buffer`: The Metal buffer containing the vertex data.
- `offset`: The byte offset into buffer where the vertex data begins.
- `semantic`: The vertex semantic of the attribute to bind.

## Discussion

Discussion note: If the semantic is absent from the descriptor, if offset is out of bounds for buffer, or if the buffer is too small for the declared stride and vertex count.
