From da529ff09ed88a88d337db25eeb9fec12c8207f1 Mon Sep 17 00:00:00 2001 From: Alice Cecile Date: Fri, 16 Aug 2024 19:43:40 -0400 Subject: [PATCH] Ignore `PipelineCache` ambiguities (#14772) # Objective The `prepare_view_upscaling_pipelines` system has dozens of ambiguities, which makes it harder to spot and prevent new ambiguities. Closes https://github.com/bevyengine/bevy/issues/14770. ## Solution Just exclude the system from ambiguity detection. See the linked issue for more context on why this resolution was chosen. ## Testing Running the `ambiguity_detection` example now reports dozens fewer `Render` app ambiguities. --- crates/bevy_core_pipeline/src/upscaling/mod.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/bevy_core_pipeline/src/upscaling/mod.rs b/crates/bevy_core_pipeline/src/upscaling/mod.rs index 9a25336356654..1f99580dbe1b3 100644 --- a/crates/bevy_core_pipeline/src/upscaling/mod.rs +++ b/crates/bevy_core_pipeline/src/upscaling/mod.rs @@ -17,7 +17,14 @@ impl Plugin for UpscalingPlugin { if let Some(render_app) = app.get_sub_app_mut(RenderApp) { render_app.add_systems( Render, - prepare_view_upscaling_pipelines.in_set(RenderSet::Prepare), + // This system should probably technically be run *after* all of the other systems + // that might modify `PipelineCache` via interior mutability, but for now, + // we've chosen to simply ignore the ambiguities out of a desire for a better refactor + // and aversion to extensive and intrusive system ordering. + // See https://github.com/bevyengine/bevy/issues/14770 for more context. + prepare_view_upscaling_pipelines + .in_set(RenderSet::Prepare) + .ambiguous_with_all(), ); } }