From 4c61d6136170ba572fd88fc6195b2c3d2c76cb34 Mon Sep 17 00:00:00 2001 From: atlas Date: Sun, 12 Apr 2026 13:52:32 -0400 Subject: [PATCH] fix(core): Keep surface texture alive through present preparation --- wgpu-core/src/device/queue.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wgpu-core/src/device/queue.rs b/wgpu-core/src/device/queue.rs index 5bd6b0b6f..977d9215b 100644 --- a/wgpu-core/src/device/queue.rs +++ b/wgpu-core/src/device/queue.rs @@ -206,6 +206,10 @@ impl Queue { } } + // Keep the texture alive in the submission so its clear_view isn't + // destroyed before the GPU finishes the submitted commands. + pending_writes.insert_texture(texture); + // Flush pending writes through the standard submission path. let mut surface_textures = FastHashMap::default(); surface_textures.insert(Arc::as_ptr(texture), texture.clone());