---
title: "readIndices(commandBuffer:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/lowlevelmeshresource/readindices(commandbuffer:)"
---

# readIndices(commandBuffer:)

Retrieves the Metal index buffer for GPU reading.

## Declaration

```swift
final func readIndices(commandBuffer: (any MTLCommandBuffer)?) -> any MTLBuffer
```

## Parameters

- `commandBuffer`: The command buffer using this buffer, or nil to skip synchronization.

## Return Value

Return Value The underlying MTLBuffer for reading.

## Discussion

Discussion The renderer waits for the command buffer to complete before discarding the buffer.

## See Also

### Accessing index data

- [readIndices(_:)](realitykit/lowlevelmeshresource/readindices(_:).md)
- [updateIndices(_:)](realitykit/lowlevelmeshresource/updateindices(_:).md)
- [replaceIndices(_:)](realitykit/lowlevelmeshresource/replaceindices(_:).md)
- [replaceIndices(commandBuffer:)](realitykit/lowlevelmeshresource/replaceindices(commandbuffer:).md)
