<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/LowLevelBufferResource",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:19RealityCoreRenderer22LowLevelBufferResourceC"
  },
  "title" : "LowLevelBufferResource"
}
-->

# LowLevelBufferResource

A GPU-managed buffer for arbitrary per-draw data such as uniforms and custom parameters.

```
final class LowLevelBufferResource
```

## Overview

Buffer contents can be read and written synchronously on the CPU via span-based accessors,
or on the GPU by writing to a `MTLBuffer` returned by `replace(commandBuffer:)`.

Create a `LowLevelBufferResource` using
[`makeBufferResource(descriptor:)`](/documentation/RealityKit/LowLevelRenderContext/makeBufferResource(descriptor:)).

## Topics

### Inspecting the descriptor

[`var descriptor: LowLevelBufferResource.Descriptor`](/documentation/RealityKit/LowLevelBufferResource/descriptor-swift.property)

The descriptor used to create this buffer resource.

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

The capacity and alignment requirements for a buffer resource.

### Reading buffer contents

[`func read(commandBuffer: (any MTLCommandBuffer)?) -> any MTLBuffer`](/documentation/RealityKit/LowLevelBufferResource/read(commandBuffer:))

Returns a Metal buffer containing the current contents of the buffer resource for GPU read operations.

[`func read<R, E>((RawSpan) throws(E) -> R) throws(E) -> R`](/documentation/RealityKit/LowLevelBufferResource/read(_:))

Reads the current contents of the buffer resource synchronously on the CPU.

### Replacing buffer contents

[`func replace(commandBuffer: (any MTLCommandBuffer)?) -> any MTLBuffer`](/documentation/RealityKit/LowLevelBufferResource/replace(commandBuffer:))

Returns a Metal buffer you populate on the GPU with the new contents of the buffer resource.

[`func replace<R, E>((inout MutableRawSpan) throws(E) -> R) throws(E) -> R`](/documentation/RealityKit/LowLevelBufferResource/replace(_:))

Replaces the entire contents of the buffer resource synchronously on the CPU.

### Instance Methods

[`func update<R, E>((inout MutableRawSpan) throws(E) -> R) throws(E) -> R`](/documentation/RealityKit/LowLevelBufferResource/update(_:))

Updates the buffer resource in place synchronously on the CPU.

---

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)