---
title: "readIndices(using:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/lowlevelmesh/readindices(using:)"
---

# readIndices(using:)

Retrieves the Metal index buffer for GPU reading.

## Declaration

```swift
@MainActor func readIndices(using commandBuffer: any MTLCommandBuffer) -> any MTLBuffer
```

## Parameters

- `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

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