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<T>) ## Testing - None, it's just code style changes
This commit is contained in:
parent
9be1c36391
commit
88c280b9d2
@ -55,19 +55,25 @@ pub struct LatePrepassNode;
|
|||||||
|
|
||||||
impl ViewNode for LatePrepassNode {
|
impl ViewNode for LatePrepassNode {
|
||||||
type ViewQuery = (
|
type ViewQuery = (
|
||||||
&'static ExtractedCamera,
|
(
|
||||||
&'static ExtractedView,
|
&'static ExtractedCamera,
|
||||||
&'static ViewDepthTexture,
|
&'static ExtractedView,
|
||||||
&'static ViewPrepassTextures,
|
&'static ViewDepthTexture,
|
||||||
&'static ViewUniformOffset,
|
&'static ViewPrepassTextures,
|
||||||
Option<&'static DeferredPrepass>,
|
&'static ViewUniformOffset,
|
||||||
Option<&'static RenderSkyboxPrepassPipeline>,
|
),
|
||||||
Option<&'static SkyboxPrepassBindGroup>,
|
(
|
||||||
Option<&'static PreviousViewUniformOffset>,
|
Option<&'static DeferredPrepass>,
|
||||||
Option<&'static MainPassResolutionOverride>,
|
Option<&'static RenderSkyboxPrepassPipeline>,
|
||||||
Has<OcclusionCulling>,
|
Option<&'static SkyboxPrepassBindGroup>,
|
||||||
Has<NoIndirectDrawing>,
|
Option<&'static PreviousViewUniformOffset>,
|
||||||
Has<DeferredPrepass>,
|
Option<&'static MainPassResolutionOverride>,
|
||||||
|
),
|
||||||
|
(
|
||||||
|
Has<OcclusionCulling>,
|
||||||
|
Has<NoIndirectDrawing>,
|
||||||
|
Has<DeferredPrepass>,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
fn run<'w>(
|
fn run<'w>(
|
||||||
@ -79,7 +85,7 @@ impl ViewNode for LatePrepassNode {
|
|||||||
) -> Result<(), NodeRunError> {
|
) -> Result<(), NodeRunError> {
|
||||||
// We only need a late prepass if we have occlusion culling and indirect
|
// We only need a late prepass if we have occlusion culling and indirect
|
||||||
// drawing.
|
// drawing.
|
||||||
let (.., occlusion_culling, no_indirect_drawing, _) = query;
|
let (_, _, (occlusion_culling, no_indirect_drawing, _)) = query;
|
||||||
if !occlusion_culling || no_indirect_drawing {
|
if !occlusion_culling || no_indirect_drawing {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
@ -101,19 +107,15 @@ fn run_prepass<'w>(
|
|||||||
graph: &mut RenderGraphContext,
|
graph: &mut RenderGraphContext,
|
||||||
render_context: &mut RenderContext<'w>,
|
render_context: &mut RenderContext<'w>,
|
||||||
(
|
(
|
||||||
camera,
|
(camera, extracted_view, view_depth_texture, view_prepass_textures, view_uniform_offset),
|
||||||
extracted_view,
|
(
|
||||||
view_depth_texture,
|
deferred_prepass,
|
||||||
view_prepass_textures,
|
skybox_prepass_pipeline,
|
||||||
view_uniform_offset,
|
skybox_prepass_bind_group,
|
||||||
deferred_prepass,
|
view_prev_uniform_offset,
|
||||||
skybox_prepass_pipeline,
|
resolution_override,
|
||||||
skybox_prepass_bind_group,
|
),
|
||||||
view_prev_uniform_offset,
|
(_, _, has_deferred),
|
||||||
resolution_override,
|
|
||||||
_,
|
|
||||||
_,
|
|
||||||
has_deferred,
|
|
||||||
): QueryItem<'w, '_, <LatePrepassNode as ViewNode>::ViewQuery>,
|
): QueryItem<'w, '_, <LatePrepassNode as ViewNode>::ViewQuery>,
|
||||||
world: &'w World,
|
world: &'w World,
|
||||||
label: &'static str,
|
label: &'static str,
|
||||||
|
Loading…
Reference in New Issue
Block a user