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

# read(commandBuffer:)

Retrieves the Metal texture for GPU reading.

## Declaration

```swift
final func read(commandBuffer: (any MTLCommandBuffer)?) -> any MTLTexture
```

## Parameters

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

## Return Value

Return Value The underlying MTLTexture for reading.

## Discussion

Discussion The renderer waits for the command buffer to complete before using the texture for rendering.

## See Also

### Reading and writing texture data

- [replace(commandBuffer:)](realitykit/lowleveltextureresource/replace(commandbuffer:).md)
