---
title: "replace(using:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/lowlevelinstancedata/replace(using:)"
---

# replace(using:)

Retrieves a Metal buffer that you can use to replace the per instance transform data on GPU using Metal.

## Declaration

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

## Discussion

Discussion The transform buffer’s contents are in an uninitialized state. The caller supplies the MTLCommandBuffer that they intend to use for transform buffer modifications. RealityKit will wait for the MTLCommandBuffer to complete before utilizing the transform buffer for rendering.
