<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/LowLevelRenderContext/waitForCommandBuffer(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:19RealityCoreRenderer21LowLevelRenderContextP20waitForCommandBufferyySo010MTLCommandK0_pF"
  },
  "title" : "waitForCommandBuffer(_:)"
}
-->

# waitForCommandBuffer(_:)

Adds a command buffer that the renderer should wait on before using resources for rendering.

```
func waitForCommandBuffer(_ commandBuffer: any MTLCommandBuffer)
```

## Parameters

`commandBuffer`

The command buffer whose completion the renderer waits for
before using the updated GPU resources.

## Discussion

Instead of passing the same command buffer to every individual `replace(commandBuffer:)`
call, you can call this method once and then pass `nil` to each GPU replace call on this
context. The renderer waits for this command buffer to complete before using any of those
resources 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)