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

# replace(commandBuffer:)

Returns a MTLBuffer for GPU-side write access to the transform data.

## Declaration

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

## Parameters

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

## Return Value

Return Value An MTLBuffer containing the transform data.

## Discussion

Discussion The renderer waits for commandBuffer to complete before reading from this buffer.

## See Also

### Replacing transform data

- [replace(_:)](realitykit/lowlevelinstancetransformresource/replace(_:).md)
