From 88c280b9d207e4c255af1ba362a0ddd3254f2ff4 Mon Sep 17 00:00:00 2001 From: IceSentry Date: Mon, 30 Jun 2025 19:08:27 -0400 Subject: [PATCH] Split LatePrepassNode query in a few groups (#19840) # Objective - That node has a bunch of query items that are mostly ignored in a few places - Previously this lead to having a long chain of ignored params that was replaced with `..,`. This works, but this seems a bit more likely to break in a subtle way if new parameters are added ## Solution - Split the query in a few groups based on how it was already structured (Mandatory, Optional, Has) ## Testing - None, it's just code style changes --- crates/bevy_core_pipeline/src/prepass/node.rs | 56 ++++++++++--------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/crates/bevy_core_pipeline/src/prepass/node.rs b/crates/bevy_core_pipeline/src/prepass/node.rs index 6193aa4f0e..c4cc7b1d55 100644 --- a/crates/bevy_core_pipeline/src/prepass/node.rs +++ b/crates/bevy_core_pipeline/src/prepass/node.rs @@ -55,19 +55,25 @@ pub struct LatePrepassNode; impl ViewNode for LatePrepassNode { type ViewQuery = ( - &'static ExtractedCamera, - &'static ExtractedView, - &'static ViewDepthTexture, - &'static ViewPrepassTextures, - &'static ViewUniformOffset, - Option<&'static DeferredPrepass>, - Option<&'static RenderSkyboxPrepassPipeline>, - Option<&'static SkyboxPrepassBindGroup>, - Option<&'static PreviousViewUniformOffset>, - Option<&'static MainPassResolutionOverride>, - Has, - Has, - Has, + ( + &'static ExtractedCamera, + &'static ExtractedView, + &'static ViewDepthTexture, + &'static ViewPrepassTextures, + &'static ViewUniformOffset, + ), + ( + Option<&'static DeferredPrepass>, + Option<&'static RenderSkyboxPrepassPipeline>, + Option<&'static SkyboxPrepassBindGroup>, + Option<&'static PreviousViewUniformOffset>, + Option<&'static MainPassResolutionOverride>, + ), + ( + Has, + Has, + Has, + ), ); fn run<'w>( @@ -79,7 +85,7 @@ impl ViewNode for LatePrepassNode { ) -> Result<(), NodeRunError> { // We only need a late prepass if we have occlusion culling and indirect // drawing. - let (.., occlusion_culling, no_indirect_drawing, _) = query; + let (_, _, (occlusion_culling, no_indirect_drawing, _)) = query; if !occlusion_culling || no_indirect_drawing { return Ok(()); } @@ -101,19 +107,15 @@ fn run_prepass<'w>( graph: &mut RenderGraphContext, render_context: &mut RenderContext<'w>, ( - camera, - extracted_view, - view_depth_texture, - view_prepass_textures, - view_uniform_offset, - deferred_prepass, - skybox_prepass_pipeline, - skybox_prepass_bind_group, - view_prev_uniform_offset, - resolution_override, - _, - _, - has_deferred, + (camera, extracted_view, view_depth_texture, view_prepass_textures, view_uniform_offset), + ( + deferred_prepass, + skybox_prepass_pipeline, + skybox_prepass_bind_group, + view_prev_uniform_offset, + resolution_override, + ), + (_, _, has_deferred), ): QueryItem<'w, '_, ::ViewQuery>, world: &'w World, label: &'static str,