<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ModelIO",
  "identifier" : "/documentation/ModelIO/MDLVertexAttribute/bufferIndex",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Model I/O"
    ],
    "preciseIdentifier" : "c:objc(cs)MDLVertexAttribute(py)bufferIndex"
  },
  "title" : "bufferIndex"
}
-->

# bufferIndex

The index of the vertex buffer containing data for this attribute in a mesh’s [`vertexBuffers`](/documentation/ModelIO/MDLMesh/vertexBuffers) array.

```
var bufferIndex: Int { get set }
```

## Discussion

A mesh may store vertex data in either a *structure of arrays* model, where data for each attribute lies in a separate vertex buffer, or in an *array of structures* model. In the latter, multiple vertex attributes share the same buffer (and thus have the same [`bufferIndex`](/documentation/ModelIO/MDLVertexAttribute/bufferIndex) value), and the [`format`](/documentation/ModelIO/MDLVertexAttribute/format) and [`offset`](/documentation/ModelIO/MDLVertexAttribute/offset) values (together with the [`stride`](/documentation/ModelIO/MDLVertexBufferLayout/stride) value of a related [`MDLVertexBufferLayout`](/documentation/ModelIO/MDLVertexBufferLayout) object) identify which bytes in that buffer refer to which vertex attributes.

---

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)