---
title: "read(commandBuffer:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/lowlevelbufferresource/read(commandbuffer:)"
---

# read(commandBuffer:)

Retrieves the Metal buffer for GPU reading.

## Declaration

```swift
final func read(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

### Reading buffer contents

- [read(_:)](realitykit/lowlevelbufferresource/read(_:).md)
