<!--
{
  "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/LowLevelInstanceData/replace(using:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation20LowLevelInstanceDataC7replace5usingSo9MTLBuffer_pSo16MTLCommandBuffer_p_tF"
  },
  "title" : "replace(using:)"
}
-->

# replace(using:)

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

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

## 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.

---

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)