From 2a9497cd913402318638c20fb296cf12ecf405c8 Mon Sep 17 00:00:00 2001 From: "Erik W. Gren" Date: Sun, 15 Dec 2024 09:50:49 +0100 Subject: [PATCH] correctly reset particle system in example upon recreation, fixes metal not rendering after reset as well --- examples/particle/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/particle/main.rs b/examples/particle/main.rs index d6a8659..481ac0f 100644 --- a/examples/particle/main.rs +++ b/examples/particle/main.rs @@ -271,6 +271,10 @@ impl Example { self.sample_count, ); self.particle_system.params = old_params; + self.command_encoder.start(); + self.particle_system.reset(&mut self.command_encoder); + let sp = self.context.submit(&mut self.command_encoder); + self.context.wait_for(&sp, !0); if let Some(msaa_view) = self.msaa_view.take() { self.context.destroy_texture_view(msaa_view);