<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/LowLevelBuffer",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation14LowLevelBufferC"
  },
  "title" : "LowLevelBuffer"
}
-->

# LowLevelBuffer

```
final class LowLevelBuffer
```

## Topics

### Structures

[`struct Descriptor`](/documentation/RealityKit/LowLevelBuffer/Descriptor-swift.struct)

### Initializers

[`init(descriptor: LowLevelBuffer.Descriptor) throws`](/documentation/RealityKit/LowLevelBuffer/init(descriptor:))

### Instance Properties

[`var bytesUsed: Int`](/documentation/RealityKit/LowLevelBuffer/bytesUsed)

[`let descriptor: LowLevelBuffer.Descriptor`](/documentation/RealityKit/LowLevelBuffer/descriptor-swift.property)

### Instance Methods

[`func read(using: any MTLCommandBuffer) -> any MTLBuffer`](/documentation/RealityKit/LowLevelBuffer/read(using:))

Retrieve the current contents of the buffer, for GPU reading.

[`func replace(using: any MTLCommandBuffer) -> any MTLBuffer`](/documentation/RealityKit/LowLevelBuffer/replace(using:))

Retrieve an MTLBuffer that can be used to replace the contents of the buffer
on GPU using Metal.

[`func replaceUnsafeMutableBytes((UnsafeMutableRawBufferPointer) -> Void)`](/documentation/RealityKit/LowLevelBuffer/replaceUnsafeMutableBytes(_:))

Replace the buffer’s contents synchronously on the CPU.

[`func withUnsafeBytes((UnsafeRawBufferPointer) -> Void)`](/documentation/RealityKit/LowLevelBuffer/withUnsafeBytes(_:))

Read the buffer synchronously on the CPU. The buffer provided is
only valid for the lifetime of the callback.

[`func withUnsafeMutableBytes((UnsafeMutableRawBufferPointer) -> Void)`](/documentation/RealityKit/LowLevelBuffer/withUnsafeMutableBytes(_:))

Update the buffer’s contents synchronously on the CPU. The buffer provided is
only valid for the lifetime of the callback.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)