<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/LowLevelMesh/Layout",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation12LowLevelMeshC6LayoutV"
  },
  "title" : "LowLevelMesh.Layout"
}
-->

# LowLevelMesh.Layout

An object that describes a set of attributes that share a buffer index, offset,
and stride.

```
struct Layout
```

## Overview

Applications typically express their types using contiguous or interleaved (strided) memory.

If you interleave your data (meaning that you represent it with a structure),
use one `Layout` object where [`bufferStride`](/documentation/RealityKit/LowLevelMesh/Layout/bufferStride) is equal to
`MemoryLayout<Type>.stride()`.

If you store your attributes separately, use one `Layout` per attribute.

## Topics

### Creating a low-level mesh layout

[`init(bufferIndex: Int, bufferOffset: Int, bufferStride: Int)`](/documentation/RealityKit/LowLevelMesh/Layout/init(bufferIndex:bufferOffset:bufferStride:))

### Describing a low-level mesh layout

[`var bufferIndex: Int`](/documentation/RealityKit/LowLevelMesh/Layout/bufferIndex)

The index of the buffer to use for this layout.

[`var bufferOffset: Int`](/documentation/RealityKit/LowLevelMesh/Layout/bufferOffset)

The byte offset into the buffer for the first byte of this layout.

[`var bufferStride: Int`](/documentation/RealityKit/LowLevelMesh/Layout/bufferStride)

The distance, in bytes, between consecutive vertices for attributes using this layout.

### Creating a layout

[`init(bufferIndex: Int, bufferOffset: Int, bufferStride: Int, stepFunction: MTLVertexStepFunction, stepRate: Int)`](/documentation/RealityKit/LowLevelMesh/Layout/init(bufferIndex:bufferOffset:bufferStride:stepFunction:stepRate:))

### Configuring vertex stepping

[`var stepFunction: MTLVertexStepFunction`](/documentation/RealityKit/LowLevelMesh/Layout/stepFunction)

Determines how the vertex shader steps through the data in this layout.

[`var stepRate: Int`](/documentation/RealityKit/LowLevelMesh/Layout/stepRate)

The number of instances that share the same per-instance vertex data.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)