From 2efa244b7851bd150df2fd95075ce528756f04fe Mon Sep 17 00:00:00 2001 From: Rusty Cube <183405087+Rusty-Cube@users.noreply.github.com> Date: Sun, 6 Oct 2024 16:11:25 +0200 Subject: [PATCH] Free textures after submitting queue instead of before with wgpu renderer. --- crates/egui-wgpu/src/winit.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/egui-wgpu/src/winit.rs b/crates/egui-wgpu/src/winit.rs index 26b3c86ae2c..d554159527e 100644 --- a/crates/egui-wgpu/src/winit.rs +++ b/crates/egui-wgpu/src/winit.rs @@ -668,13 +668,6 @@ impl Painter { ); } - { - let mut renderer = render_state.renderer.write(); - for id in &textures_delta.free { - renderer.free_texture(id); - } - } - let encoded = { crate::profile_scope!("CommandEncoder::finish"); encoder.finish() @@ -691,6 +684,13 @@ impl Painter { vsync_sec += start.elapsed().as_secs_f32(); }; + { + let mut renderer = render_state.renderer.write(); + for id in &textures_delta.free { + renderer.free_texture(id); + } + } + let screenshot = if capture { self.screen_capture_state .as_ref()