From 3b3186ce4aa7db895121ee9ab24a43ee65ed634f Mon Sep 17 00:00:00 2001 From: Kevin Reid Date: Sun, 24 Nov 2024 10:26:18 -0800 Subject: [PATCH] gpu: Use dirty flag to decide whether to re-trace in `RaytraceToTexture`. --- all-is-cubes-gpu/src/in_wgpu/raytrace_to_texture.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/all-is-cubes-gpu/src/in_wgpu/raytrace_to_texture.rs b/all-is-cubes-gpu/src/in_wgpu/raytrace_to_texture.rs index 2d44c45cf..da1c701f4 100644 --- a/all-is-cubes-gpu/src/in_wgpu/raytrace_to_texture.rs +++ b/all-is-cubes-gpu/src/in_wgpu/raytrace_to_texture.rs @@ -132,8 +132,9 @@ impl RaytraceToTexture { impl Inner { fn update_inputs(&mut self, cursor: Option<&Cursor>) -> Result<(), RenderError> { - self.rtr.update(cursor)?; - self.dirty(); + if self.rtr.update(cursor)? { + self.dirty(); + } Ok(()) }