From c33b8b92c0771dfa03cbfc2313bf7226a5264666 Mon Sep 17 00:00:00 2001 From: Boris Boutillier Date: Wed, 7 Feb 2024 17:05:36 +0100 Subject: [PATCH] Properly check for result when getting pipeline in Msaa (#11758) # Objective - This aims to fix #11755 - After #10812 some pipeline compilation can take more time than before and all call to `get_render_pipeline` should check the result. ## Solution - Check `get_render_pipeline` call result for msaa_writeback - I checked that no other call to `get_render_pipeline` in bevy code base is missng the checking on the result. --- crates/bevy_core_pipeline/src/msaa_writeback.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/bevy_core_pipeline/src/msaa_writeback.rs b/crates/bevy_core_pipeline/src/msaa_writeback.rs index 17af382e86..d84e9dc3b4 100644 --- a/crates/bevy_core_pipeline/src/msaa_writeback.rs +++ b/crates/bevy_core_pipeline/src/msaa_writeback.rs @@ -78,9 +78,9 @@ impl Node for MsaaWritebackNode { if let Ok((target, blit_pipeline_id)) = self.cameras.get_manual(world, view_entity) { let blit_pipeline = world.resource::(); let pipeline_cache = world.resource::(); - let pipeline = pipeline_cache - .get_render_pipeline(blit_pipeline_id.0) - .unwrap(); + let Some(pipeline) = pipeline_cache.get_render_pipeline(blit_pipeline_id.0) else { + return Ok(()); + }; // The current "main texture" needs to be bound as an input resource, and we need the "other" // unused target to be the "resolve target" for the MSAA write. Therefore this is the same