Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert rendering-related associated type name changes #11027

Merged
merged 6 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/bevy_core_pipeline/src/bloom/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl Plugin for BloomPlugin {
#[derive(Default)]
struct BloomNode;
impl ViewNode for BloomNode {
type ViewData = (
type ViewQuery = (
&'static ExtractedCamera,
&'static ViewTarget,
&'static BloomTexture,
Expand All @@ -140,7 +140,7 @@ impl ViewNode for BloomNode {
bloom_settings,
upsampling_pipeline_ids,
downsampling_pipeline_ids,
): QueryItem<Self::ViewData>,
): QueryItem<Self::ViewQuery>,
world: &World,
) -> Result<(), NodeRunError> {
let downsampling_pipeline_res = world.resource::<BloomDownsamplingPipeline>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use super::{AlphaMask3d, Camera3dDepthLoadOp};
#[derive(Default)]
pub struct MainOpaquePass3dNode;
impl ViewNode for MainOpaquePass3dNode {
type ViewData = (
type ViewQuery = (
&'static ExtractedCamera,
&'static RenderPhase<Opaque3d>,
&'static RenderPhase<AlphaMask3d>,
Expand Down Expand Up @@ -59,7 +59,7 @@ impl ViewNode for MainOpaquePass3dNode {
skybox_pipeline,
skybox_bind_group,
view_uniform_offset,
): QueryItem<Self::ViewData>,
): QueryItem<Self::ViewQuery>,
world: &World,
) -> Result<(), NodeRunError> {
let load = if deferred_prepass.is_none() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use std::ops::Range;
pub struct MainTransmissivePass3dNode;

impl ViewNode for MainTransmissivePass3dNode {
type ViewData = (
type ViewQuery = (
&'static ExtractedCamera,
&'static Camera3d,
&'static RenderPhase<Transmissive3d>,
Expand All @@ -35,7 +35,7 @@ impl ViewNode for MainTransmissivePass3dNode {
graph: &mut RenderGraphContext,
render_context: &mut RenderContext,
(camera, camera_3d, transmissive_phase, target, transmission, depth): QueryItem<
Self::ViewData,
Self::ViewQuery,
>,
world: &World,
) -> Result<(), NodeRunError> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use bevy_utils::tracing::info_span;
pub struct MainTransparentPass3dNode;

impl ViewNode for MainTransparentPass3dNode {
type ViewData = (
type ViewQuery = (
&'static ExtractedCamera,
&'static RenderPhase<Transparent3d>,
&'static ViewTarget,
Expand All @@ -28,7 +28,7 @@ impl ViewNode for MainTransparentPass3dNode {
&self,
graph: &mut RenderGraphContext,
render_context: &mut RenderContext,
(camera, transparent_phase, target, depth): QueryItem<Self::ViewData>,
(camera, transparent_phase, target, depth): QueryItem<Self::ViewQuery>,
world: &World,
) -> Result<(), NodeRunError> {
let view_entity = graph.view_entity();
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_core_pipeline/src/deferred/copy_lighting_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl CopyDeferredLightingIdNode {
}

impl ViewNode for CopyDeferredLightingIdNode {
type ViewData = (
type ViewQuery = (
&'static ViewTarget,
&'static ViewPrepassTextures,
&'static DeferredLightingIdDepthTexture,
Expand All @@ -72,7 +72,7 @@ impl ViewNode for CopyDeferredLightingIdNode {
_graph: &mut RenderGraphContext,
render_context: &mut RenderContext,
(_view_target, view_prepass_textures, deferred_lighting_id_depth_texture): QueryItem<
Self::ViewData,
Self::ViewQuery,
>,
world: &World,
) -> Result<(), NodeRunError> {
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_core_pipeline/src/deferred/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use super::{AlphaMask3dDeferred, Opaque3dDeferred};
pub struct DeferredGBufferPrepassNode;

impl ViewNode for DeferredGBufferPrepassNode {
type ViewData = (
type ViewQuery = (
&'static ExtractedCamera,
&'static RenderPhase<Opaque3dDeferred>,
&'static RenderPhase<AlphaMask3dDeferred>,
Expand All @@ -56,7 +56,7 @@ impl ViewNode for DeferredGBufferPrepassNode {
depth_prepass,
normal_prepass,
motion_vector_prepass,
): QueryItem<Self::ViewData>,
): QueryItem<Self::ViewQuery>,
world: &World,
) -> Result<(), NodeRunError> {
let view_entity = graph.view_entity();
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_core_pipeline/src/fxaa/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub struct FxaaNode {
}

impl ViewNode for FxaaNode {
type ViewData = (
type ViewQuery = (
&'static ViewTarget,
&'static CameraFxaaPipeline,
&'static Fxaa,
Expand All @@ -30,7 +30,7 @@ impl ViewNode for FxaaNode {
&self,
_graph: &mut RenderGraphContext,
render_context: &mut RenderContext,
(target, pipeline, fxaa): QueryItem<Self::ViewData>,
(target, pipeline, fxaa): QueryItem<Self::ViewQuery>,
world: &World,
) -> Result<(), NodeRunError> {
let pipeline_cache = world.resource::<PipelineCache>();
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_core_pipeline/src/prepass/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use super::{AlphaMask3dPrepass, DeferredPrepass, Opaque3dPrepass, ViewPrepassTex
pub struct PrepassNode;

impl ViewNode for PrepassNode {
type ViewData = (
type ViewQuery = (
&'static ExtractedCamera,
&'static RenderPhase<Opaque3dPrepass>,
&'static RenderPhase<AlphaMask3dPrepass>,
Expand All @@ -46,7 +46,7 @@ impl ViewNode for PrepassNode {
view_depth_texture,
view_prepass_textures,
deferred_prepass,
): QueryItem<Self::ViewData>,
): QueryItem<Self::ViewQuery>,
world: &World,
) -> Result<(), NodeRunError> {
let view_entity = graph.view_entity();
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_core_pipeline/src/taa/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ impl Default for TemporalAntiAliasSettings {
pub struct TemporalAntiAliasNode;

impl ViewNode for TemporalAntiAliasNode {
type ViewData = (
type ViewQuery = (
&'static ExtractedCamera,
&'static ViewTarget,
&'static TemporalAntiAliasHistoryTextures,
Expand All @@ -181,7 +181,7 @@ impl ViewNode for TemporalAntiAliasNode {
_graph: &mut RenderGraphContext,
render_context: &mut RenderContext,
(camera, view_target, taa_history_textures, prepass_textures, taa_pipeline_id): QueryItem<
Self::ViewData,
Self::ViewQuery,
>,
world: &World,
) -> Result<(), NodeRunError> {
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_core_pipeline/src/tonemapping/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub struct TonemappingNode {
}

impl ViewNode for TonemappingNode {
type ViewData = (
type ViewQuery = (
&'static ViewUniformOffset,
&'static ViewTarget,
&'static ViewTonemappingPipeline,
Expand All @@ -36,7 +36,7 @@ impl ViewNode for TonemappingNode {
_graph: &mut RenderGraphContext,
render_context: &mut RenderContext,
(view_uniform_offset, target, view_tonemapping_pipeline, tonemapping): QueryItem<
Self::ViewData,
Self::ViewQuery,
>,
world: &World,
) -> Result<(), NodeRunError> {
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_core_pipeline/src/upscaling/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub struct UpscalingNode {
}

impl ViewNode for UpscalingNode {
type ViewData = (
type ViewQuery = (
&'static ViewTarget,
&'static ViewUpscalingPipeline,
Option<&'static ExtractedCamera>,
Expand All @@ -28,7 +28,7 @@ impl ViewNode for UpscalingNode {
&self,
_graph: &mut RenderGraphContext,
render_context: &mut RenderContext,
(target, upscaling_target, camera): QueryItem<Self::ViewData>,
(target, upscaling_target, camera): QueryItem<Self::ViewQuery>,
world: &World,
) -> Result<(), NodeRunError> {
let pipeline_cache = world.get_resource::<PipelineCache>().unwrap();
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_pbr/src/deferred/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ pub const DEFERRED_LIGHTING_PASS: &str = "deferred_opaque_pbr_lighting_pass_3d";
pub struct DeferredOpaquePass3dPbrLightingNode;

impl ViewNode for DeferredOpaquePass3dPbrLightingNode {
type ViewData = (
type ViewQuery = (
&'static ViewUniformOffset,
&'static ViewLightsUniformOffset,
&'static ViewFogUniformOffset,
Expand All @@ -173,7 +173,7 @@ impl ViewNode for DeferredOpaquePass3dPbrLightingNode {
deferred_lighting_id_depth_texture,
camera_3d,
deferred_lighting_pipeline,
): QueryItem<Self::ViewData>,
): QueryItem<Self::ViewQuery>,
world: &World,
) -> Result<(), NodeRunError> {
let pipeline_cache = world.resource::<PipelineCache>();
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_pbr/src/ssao/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ impl ScreenSpaceAmbientOcclusionQualityLevel {
struct SsaoNode {}

impl ViewNode for SsaoNode {
type ViewData = (
type ViewQuery = (
&'static ExtractedCamera,
&'static SsaoPipelineId,
&'static SsaoBindGroups,
Expand All @@ -210,7 +210,7 @@ impl ViewNode for SsaoNode {
&self,
_graph: &mut RenderGraphContext,
render_context: &mut RenderContext,
(camera, pipeline_id, bind_groups, view_uniform_offset): QueryItem<Self::ViewData>,
(camera, pipeline_id, bind_groups, view_uniform_offset): QueryItem<Self::ViewQuery>,
world: &World,
) -> Result<(), NodeRunError> {
let pipelines = world.resource::<SsaoPipelines>();
Expand Down
6 changes: 3 additions & 3 deletions crates/bevy_render/src/render_graph/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ impl Node for RunGraphOnViewNode {
pub trait ViewNode {
/// The query that will be used on the view entity.
/// It is guaranteed to run on the view entity, so there's no need for a filter
type ViewData: ReadOnlyQueryData;
type ViewQuery: ReadOnlyQueryData;

/// Updates internal node state using the current render [`World`] prior to the run method.
fn update(&mut self, _world: &mut World) {}
Expand All @@ -354,7 +354,7 @@ pub trait ViewNode {
&self,
graph: &mut RenderGraphContext,
render_context: &mut RenderContext,
view_query: QueryItem<Self::ViewData>,
view_query: QueryItem<Self::ViewQuery>,
world: &World,
) -> Result<(), NodeRunError>;
}
Expand All @@ -364,7 +364,7 @@ pub trait ViewNode {
///
/// This [`Node`] exists to help reduce boilerplate when making a render node that runs on a view.
pub struct ViewNodeRunner<N: ViewNode> {
view_query: QueryState<N::ViewData>,
view_query: QueryState<N::ViewQuery>,
node: N,
}

Expand Down
4 changes: 2 additions & 2 deletions examples/shader/post_processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ impl ViewNode for PostProcessNode {
// but it's not a normal system so we need to define it manually.
//
// This query will only run on the view entity
type ViewData = (
type ViewQuery = (
&'static ViewTarget,
// This makes sure the node only runs on cameras with the PostProcessSettings component
&'static PostProcessSettings,
Expand All @@ -133,7 +133,7 @@ impl ViewNode for PostProcessNode {
&self,
_graph: &mut RenderGraphContext,
render_context: &mut RenderContext,
(view_target, _post_process_settings): QueryItem<Self::ViewData>,
(view_target, _post_process_settings): QueryItem<Self::ViewQuery>,
world: &World,
) -> Result<(), NodeRunError> {
// Get the pipeline resource that contains the global data we need
Expand Down