From 6995ab1c3c7e665c651cf2c2340479f7f7d7da9f Mon Sep 17 00:00:00 2001 From: Paris DOUADY Date: Thu, 11 Jul 2024 10:54:18 +0200 Subject: [PATCH] update defines before invalidating pipelines related to MSAA --- engine/src/gfx.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/engine/src/gfx.rs b/engine/src/gfx.rs index 2fa11435..19958f56 100644 --- a/engine/src/gfx.rs +++ b/engine/src/gfx.rs @@ -630,13 +630,6 @@ impl GfxContext { false => 1, }; - if self.samples != samples { - self.samples = samples; - self.pipelines.write().unwrap().invalidate_all(); - self.fbos = Self::create_textures(&self.device, &self.sc_desc, samples); - self.update_simplelit_bg(); - } - self.set_define_flag("FOG", settings.fog); self.set_define_flag("SSAO", settings.ssao); self.set_define_flag("TERRAIN_GRID", settings.terrain_grid); @@ -645,6 +638,13 @@ impl GfxContext { self.set_define_flag("PBR_ENABLED", settings.pbr_enabled); self.set_define_flag("MSAA", settings.msaa); + if self.samples != samples { + self.samples = samples; + self.pipelines.write().unwrap().invalidate_all(); + self.fbos = Self::create_textures(&self.device, &self.sc_desc, samples); + self.update_simplelit_bg(); + } + self.settings = Some(settings); }