From 58b613587245d003a385cbba26cbeff6c0af736d Mon Sep 17 00:00:00 2001 From: Connor Fitzgerald Date: Wed, 30 Jul 2025 19:58:08 -0400 Subject: [PATCH] hal/vulkan: Clear framebuffer cache during command buffer reset (#8031) --- wgpu-hal/src/vulkan/command.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wgpu-hal/src/vulkan/command.rs b/wgpu-hal/src/vulkan/command.rs index 65ee0daa9..ec9e44f2e 100644 --- a/wgpu-hal/src/vulkan/command.rs +++ b/wgpu-hal/src/vulkan/command.rs @@ -180,6 +180,10 @@ impl crate::CommandEncoder for super::CommandEncoder { self.free .extend(cmd_bufs.into_iter().map(|cmd_buf| cmd_buf.raw)); self.free.append(&mut self.discarded); + // Delete framebuffers from the framebuffer cache + for (_, framebuffer) in self.framebuffers.drain() { + unsafe { self.device.raw.destroy_framebuffer(framebuffer, None) }; + } let _ = unsafe { self.device .raw