Skip to content

Commit

Permalink
Free textures after submitting queue instead of before with wgpu rend…
Browse files Browse the repository at this point in the history
…erer.
  • Loading branch information
Rusty-Cube committed Oct 6, 2024
1 parent 0f2b427 commit 2efa244
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions crates/egui-wgpu/src/winit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down

0 comments on commit 2efa244

Please sign in to comment.