From 0a426d2f80d7257dad2627a0f680815c2040f8a1 Mon Sep 17 00:00:00 2001 From: Milosz Filimowski Date: Tue, 15 Sep 2026 14:02:32 +0200 Subject: [PATCH] fix(react-native): release camera imports for frames the kernel skips A frame kernel may skip render() to drop a frame, but the camera frame was already imported as an external texture. Dawn releases that import only once queue work completes, so with nothing submitted each skipped frame kept its camera buffer alive. Submit an empty command list for skipped frames. --- src/react-native/webgpu/webGpuFrameRenderLoop.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/react-native/webgpu/webGpuFrameRenderLoop.ts b/src/react-native/webgpu/webGpuFrameRenderLoop.ts index 520b428..be6d77f 100644 --- a/src/react-native/webgpu/webGpuFrameRenderLoop.ts +++ b/src/react-native/webgpu/webGpuFrameRenderLoop.ts @@ -200,6 +200,11 @@ export function createWebGpuFrameRenderer( }; onFrame(render); + if (!rendered) { + // A dropped frame still imported the camera. Dawn frees that import only after queue work + // completes, so with nothing submitted every skipped frame's camera buffer stays alive. + device.queue.submit([]); + } } finally { // End the camera texture's access window now — waiting for GC would starve the camera's // own frame buffer pool.