---
title: "read(bufferIndex:using:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/lowlevelmesh/read(bufferindex:using:)"
---

# read(bufferIndex:using:)

Retrieves a Metal vertex buffer at the specified index, for GPU reading.

## Declaration

```swift
@MainActor func read(bufferIndex index: Int, using commandBuffer: any MTLCommandBuffer) -> any MTLBuffer
```

## Parameters

- `index`: The index of the buffer to read. Use a value that is less than doc://com.apple.RealityKit/documentation/RealityKit/LowLevelMesh/Descriptor-swift.struct/vertexBufferCount.
- `commandBuffer`: The doc://com.apple.documentation/documentation/Metal/MTLCommandBuffer you intend to use for reading. RealityKit waits for the command buffer to complete before discarding the buffer.

## See Also

### Accessing mesh data on the GPU with Metal

- [readIndices(using:)](realitykit/lowlevelmesh/readindices(using:).md)
- [replace(bufferIndex:using:)](realitykit/lowlevelmesh/replace(bufferindex:using:).md)
- [replaceIndices(using:)](realitykit/lowlevelmesh/replaceindices(using:).md)
