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.
This commit is contained in:
Boris Boutillier 2024-02-07 17:05:36 +01:00 committed by GitHub
parent f514d5cc15
commit c33b8b92c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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::<BlitPipeline>();
let pipeline_cache = world.resource::<PipelineCache>();
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