Skip to content

Commit eb07d16

Browse files
Revert rendering-related associated type name changes (#11027)
# Objective > Can anyone explain to me the reasoning of renaming all the types named Query to Data. I'm talking about this PR #10779 It doesn't make sense to me that a bunch of types that are used to run queries aren't named Query anymore. Like ViewQuery on the ViewNode is the type of the Query. I don't really understand the point of the rename, it just seems like it hides the fact that a query will run based on those types. [@IceSentry](https://discord.com/channels/691052431525675048/692572690833473578/1184946251431694387) ## Solution Revert several renames in #10779. ## Changelog - `ViewNode::ViewData` is now `ViewNode::ViewQuery` again. ## Migration Guide - This PR amends the migration guide in #10779 --------- Co-authored-by: atlas dostal <[email protected]>
1 parent 8afb3ce commit eb07d16

File tree

34 files changed

+130
-130
lines changed

34 files changed

+130
-130
lines changed

crates/bevy_core_pipeline/src/bloom/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl Plugin for BloomPlugin {
113113
#[derive(Default)]
114114
struct BloomNode;
115115
impl ViewNode for BloomNode {
116-
type ViewData = (
116+
type ViewQuery = (
117117
&'static ExtractedCamera,
118118
&'static ViewTarget,
119119
&'static BloomTexture,
@@ -140,7 +140,7 @@ impl ViewNode for BloomNode {
140140
bloom_settings,
141141
upsampling_pipeline_ids,
142142
downsampling_pipeline_ids,
143-
): QueryItem<Self::ViewData>,
143+
): QueryItem<Self::ViewQuery>,
144144
world: &World,
145145
) -> Result<(), NodeRunError> {
146146
let downsampling_pipeline_res = world.resource::<BloomDownsamplingPipeline>();

crates/bevy_core_pipeline/src/bloom/settings.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,12 @@ pub enum BloomCompositeMode {
182182
}
183183

184184
impl ExtractComponent for BloomSettings {
185-
type Data = (&'static Self, &'static Camera);
185+
type QueryData = (&'static Self, &'static Camera);
186186

187-
type Filter = ();
187+
type QueryFilter = ();
188188
type Out = (Self, BloomUniforms);
189189

190-
fn extract_component((settings, camera): QueryItem<'_, Self::Data>) -> Option<Self::Out> {
190+
fn extract_component((settings, camera): QueryItem<'_, Self::QueryData>) -> Option<Self::Out> {
191191
match (
192192
camera.physical_viewport_rect(),
193193
camera.physical_viewport_size(),

crates/bevy_core_pipeline/src/contrast_adaptive_sharpening/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ pub struct CASUniform {
7777
}
7878

7979
impl ExtractComponent for ContrastAdaptiveSharpeningSettings {
80-
type Data = &'static Self;
81-
type Filter = With<Camera>;
80+
type QueryData = &'static Self;
81+
type QueryFilter = With<Camera>;
8282
type Out = (DenoiseCAS, CASUniform);
8383

84-
fn extract_component(item: QueryItem<Self::Data>) -> Option<Self::Out> {
84+
fn extract_component(item: QueryItem<Self::QueryData>) -> Option<Self::Out> {
8585
if !item.enabled || item.sharpening_strength == 0.0 {
8686
return None;
8787
}

crates/bevy_core_pipeline/src/core_3d/main_opaque_pass_3d_node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use super::AlphaMask3d;
2020
#[derive(Default)]
2121
pub struct MainOpaquePass3dNode;
2222
impl ViewNode for MainOpaquePass3dNode {
23-
type ViewData = (
23+
type ViewQuery = (
2424
&'static ExtractedCamera,
2525
&'static RenderPhase<Opaque3d>,
2626
&'static RenderPhase<AlphaMask3d>,
@@ -44,7 +44,7 @@ impl ViewNode for MainOpaquePass3dNode {
4444
skybox_pipeline,
4545
skybox_bind_group,
4646
view_uniform_offset,
47-
): QueryItem<Self::ViewData>,
47+
): QueryItem<Self::ViewQuery>,
4848
world: &World,
4949
) -> Result<(), NodeRunError> {
5050
// Run the opaque pass, sorted front-to-back

crates/bevy_core_pipeline/src/core_3d/main_transmissive_pass_3d_node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use std::ops::Range;
1818
pub struct MainTransmissivePass3dNode;
1919

2020
impl ViewNode for MainTransmissivePass3dNode {
21-
type ViewData = (
21+
type ViewQuery = (
2222
&'static ExtractedCamera,
2323
&'static Camera3d,
2424
&'static RenderPhase<Transmissive3d>,
@@ -32,7 +32,7 @@ impl ViewNode for MainTransmissivePass3dNode {
3232
graph: &mut RenderGraphContext,
3333
render_context: &mut RenderContext,
3434
(camera, camera_3d, transmissive_phase, target, transmission, depth): QueryItem<
35-
Self::ViewData,
35+
Self::ViewQuery,
3636
>,
3737
world: &World,
3838
) -> Result<(), NodeRunError> {

crates/bevy_core_pipeline/src/core_3d/main_transparent_pass_3d_node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use bevy_utils::tracing::info_span;
1616
pub struct MainTransparentPass3dNode;
1717

1818
impl ViewNode for MainTransparentPass3dNode {
19-
type ViewData = (
19+
type ViewQuery = (
2020
&'static ExtractedCamera,
2121
&'static RenderPhase<Transparent3d>,
2222
&'static ViewTarget,
@@ -26,7 +26,7 @@ impl ViewNode for MainTransparentPass3dNode {
2626
&self,
2727
graph: &mut RenderGraphContext,
2828
render_context: &mut RenderContext,
29-
(camera, transparent_phase, target, depth): QueryItem<Self::ViewData>,
29+
(camera, transparent_phase, target, depth): QueryItem<Self::ViewQuery>,
3030
world: &World,
3131
) -> Result<(), NodeRunError> {
3232
let view_entity = graph.view_entity();

crates/bevy_core_pipeline/src/deferred/copy_lighting_id.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl CopyDeferredLightingIdNode {
6161
}
6262

6363
impl ViewNode for CopyDeferredLightingIdNode {
64-
type ViewData = (
64+
type ViewQuery = (
6565
&'static ViewTarget,
6666
&'static ViewPrepassTextures,
6767
&'static DeferredLightingIdDepthTexture,
@@ -72,7 +72,7 @@ impl ViewNode for CopyDeferredLightingIdNode {
7272
_graph: &mut RenderGraphContext,
7373
render_context: &mut RenderContext,
7474
(_view_target, view_prepass_textures, deferred_lighting_id_depth_texture): QueryItem<
75-
Self::ViewData,
75+
Self::ViewQuery,
7676
>,
7777
world: &World,
7878
) -> Result<(), NodeRunError> {

crates/bevy_core_pipeline/src/deferred/node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use super::{AlphaMask3dDeferred, Opaque3dDeferred};
2626
pub struct DeferredGBufferPrepassNode;
2727

2828
impl ViewNode for DeferredGBufferPrepassNode {
29-
type ViewData = (
29+
type ViewQuery = (
3030
&'static ExtractedCamera,
3131
&'static RenderPhase<Opaque3dDeferred>,
3232
&'static RenderPhase<AlphaMask3dDeferred>,
@@ -44,7 +44,7 @@ impl ViewNode for DeferredGBufferPrepassNode {
4444
alpha_mask_deferred_phase,
4545
view_depth_texture,
4646
view_prepass_textures,
47-
): QueryItem<Self::ViewData>,
47+
): QueryItem<Self::ViewQuery>,
4848
world: &World,
4949
) -> Result<(), NodeRunError> {
5050
let view_entity = graph.view_entity();

crates/bevy_core_pipeline/src/fxaa/node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub struct FxaaNode {
2020
}
2121

2222
impl ViewNode for FxaaNode {
23-
type ViewData = (
23+
type ViewQuery = (
2424
&'static ViewTarget,
2525
&'static CameraFxaaPipeline,
2626
&'static Fxaa,
@@ -30,7 +30,7 @@ impl ViewNode for FxaaNode {
3030
&self,
3131
_graph: &mut RenderGraphContext,
3232
render_context: &mut RenderContext,
33-
(target, pipeline, fxaa): QueryItem<Self::ViewData>,
33+
(target, pipeline, fxaa): QueryItem<Self::ViewQuery>,
3434
world: &World,
3535
) -> Result<(), NodeRunError> {
3636
let pipeline_cache = world.resource::<PipelineCache>();

crates/bevy_core_pipeline/src/prepass/node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use super::{AlphaMask3dPrepass, DeferredPrepass, Opaque3dPrepass, ViewPrepassTex
2222
pub struct PrepassNode;
2323

2424
impl ViewNode for PrepassNode {
25-
type ViewData = (
25+
type ViewQuery = (
2626
&'static ExtractedCamera,
2727
&'static RenderPhase<Opaque3dPrepass>,
2828
&'static RenderPhase<AlphaMask3dPrepass>,
@@ -42,7 +42,7 @@ impl ViewNode for PrepassNode {
4242
view_depth_texture,
4343
view_prepass_textures,
4444
deferred_prepass,
45-
): QueryItem<Self::ViewData>,
45+
): QueryItem<Self::ViewQuery>,
4646
world: &World,
4747
) -> Result<(), NodeRunError> {
4848
let view_entity = graph.view_entity();

crates/bevy_core_pipeline/src/skybox/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ pub struct Skybox {
8080
}
8181

8282
impl ExtractComponent for Skybox {
83-
type Data = (&'static Self, Option<&'static ExposureSettings>);
84-
type Filter = ();
83+
type QueryData = (&'static Self, Option<&'static ExposureSettings>);
84+
type QueryFilter = ();
8585
type Out = (Self, SkyboxUniforms);
8686

8787
fn extract_component(
88-
(skybox, exposure_settings): QueryItem<'_, Self::Data>,
88+
(skybox, exposure_settings): QueryItem<'_, Self::QueryData>,
8989
) -> Option<Self::Out> {
9090
let exposure = exposure_settings
9191
.map(|e| e.exposure())

crates/bevy_core_pipeline/src/taa/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ impl Default for TemporalAntiAliasSettings {
168168
pub struct TemporalAntiAliasNode;
169169

170170
impl ViewNode for TemporalAntiAliasNode {
171-
type ViewData = (
171+
type ViewQuery = (
172172
&'static ExtractedCamera,
173173
&'static ViewTarget,
174174
&'static TemporalAntiAliasHistoryTextures,
@@ -181,7 +181,7 @@ impl ViewNode for TemporalAntiAliasNode {
181181
_graph: &mut RenderGraphContext,
182182
render_context: &mut RenderContext,
183183
(camera, view_target, taa_history_textures, prepass_textures, taa_pipeline_id): QueryItem<
184-
Self::ViewData,
184+
Self::ViewQuery,
185185
>,
186186
world: &World,
187187
) -> Result<(), NodeRunError> {

crates/bevy_core_pipeline/src/tonemapping/node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub struct TonemappingNode {
2424
}
2525

2626
impl ViewNode for TonemappingNode {
27-
type ViewData = (
27+
type ViewQuery = (
2828
&'static ViewUniformOffset,
2929
&'static ViewTarget,
3030
&'static ViewTonemappingPipeline,
@@ -36,7 +36,7 @@ impl ViewNode for TonemappingNode {
3636
_graph: &mut RenderGraphContext,
3737
render_context: &mut RenderContext,
3838
(view_uniform_offset, target, view_tonemapping_pipeline, tonemapping): QueryItem<
39-
Self::ViewData,
39+
Self::ViewQuery,
4040
>,
4141
world: &World,
4242
) -> Result<(), NodeRunError> {

crates/bevy_core_pipeline/src/upscaling/node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub struct UpscalingNode {
1818
}
1919

2020
impl ViewNode for UpscalingNode {
21-
type ViewData = (
21+
type ViewQuery = (
2222
&'static ViewTarget,
2323
&'static ViewUpscalingPipeline,
2424
Option<&'static ExtractedCamera>,
@@ -28,7 +28,7 @@ impl ViewNode for UpscalingNode {
2828
&self,
2929
_graph: &mut RenderGraphContext,
3030
render_context: &mut RenderContext,
31-
(target, upscaling_target, camera): QueryItem<Self::ViewData>,
31+
(target, upscaling_target, camera): QueryItem<Self::ViewQuery>,
3232
world: &World,
3333
) -> Result<(), NodeRunError> {
3434
let pipeline_cache = world.get_resource::<PipelineCache>().unwrap();

crates/bevy_gizmos/src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -343,14 +343,14 @@ fn prepare_line_gizmo_bind_group(
343343
struct SetLineGizmoBindGroup<const I: usize>;
344344
impl<const I: usize, P: PhaseItem> RenderCommand<P> for SetLineGizmoBindGroup<I> {
345345
type Param = SRes<LineGizmoUniformBindgroup>;
346-
type ViewData = ();
347-
type ItemData = Read<DynamicUniformIndex<LineGizmoUniform>>;
346+
type ViewQuery = ();
347+
type ItemQuery = Read<DynamicUniformIndex<LineGizmoUniform>>;
348348

349349
#[inline]
350350
fn render<'w>(
351351
_item: &P,
352-
_view: ROQueryItem<'w, Self::ViewData>,
353-
uniform_index: ROQueryItem<'w, Self::ItemData>,
352+
_view: ROQueryItem<'w, Self::ViewQuery>,
353+
uniform_index: ROQueryItem<'w, Self::ItemQuery>,
354354
bind_group: SystemParamItem<'w, '_, Self::Param>,
355355
pass: &mut TrackedRenderPass<'w>,
356356
) -> RenderCommandResult {
@@ -366,14 +366,14 @@ impl<const I: usize, P: PhaseItem> RenderCommand<P> for SetLineGizmoBindGroup<I>
366366
struct DrawLineGizmo;
367367
impl<P: PhaseItem> RenderCommand<P> for DrawLineGizmo {
368368
type Param = SRes<RenderAssets<LineGizmo>>;
369-
type ViewData = ();
370-
type ItemData = Read<Handle<LineGizmo>>;
369+
type ViewQuery = ();
370+
type ItemQuery = Read<Handle<LineGizmo>>;
371371

372372
#[inline]
373373
fn render<'w>(
374374
_item: &P,
375-
_view: ROQueryItem<'w, Self::ViewData>,
376-
handle: ROQueryItem<'w, Self::ItemData>,
375+
_view: ROQueryItem<'w, Self::ViewQuery>,
376+
handle: ROQueryItem<'w, Self::ItemQuery>,
377377
line_gizmos: SystemParamItem<'w, '_, Self::Param>,
378378
pass: &mut TrackedRenderPass<'w>,
379379
) -> RenderCommandResult {

crates/bevy_pbr/src/deferred/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ pub const DEFERRED_LIGHTING_PASS: &str = "deferred_opaque_pbr_lighting_pass_3d";
142142
pub struct DeferredOpaquePass3dPbrLightingNode;
143143

144144
impl ViewNode for DeferredOpaquePass3dPbrLightingNode {
145-
type ViewData = (
145+
type ViewQuery = (
146146
&'static ViewUniformOffset,
147147
&'static ViewLightsUniformOffset,
148148
&'static ViewFogUniformOffset,
@@ -166,7 +166,7 @@ impl ViewNode for DeferredOpaquePass3dPbrLightingNode {
166166
target,
167167
deferred_lighting_id_depth_texture,
168168
deferred_lighting_pipeline,
169-
): QueryItem<Self::ViewData>,
169+
): QueryItem<Self::ViewQuery>,
170170
world: &World,
171171
) -> Result<(), NodeRunError> {
172172
let pipeline_cache = world.resource::<PipelineCache>();

crates/bevy_pbr/src/light_probe/environment_map.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,11 @@ pub(crate) enum RenderViewBindGroupEntries<'a> {
185185
}
186186

187187
impl ExtractInstance for EnvironmentMapIds {
188-
type Data = Read<EnvironmentMapLight>;
188+
type QueryData = Read<EnvironmentMapLight>;
189189

190-
type Filter = ();
190+
type QueryFilter = ();
191191

192-
fn extract(item: QueryItem<'_, Self::Data>) -> Option<Self> {
192+
fn extract(item: QueryItem<'_, Self::QueryData>) -> Option<Self> {
193193
Some(EnvironmentMapIds {
194194
diffuse: item.diffuse_map.id(),
195195
specular: item.specular_map.id(),

crates/bevy_pbr/src/material.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,8 @@ type DrawMaterial<M> = (
379379
pub struct SetMaterialBindGroup<M: Material, const I: usize>(PhantomData<M>);
380380
impl<P: PhaseItem, M: Material, const I: usize> RenderCommand<P> for SetMaterialBindGroup<M, I> {
381381
type Param = (SRes<RenderMaterials<M>>, SRes<RenderMaterialInstances<M>>);
382-
type ViewData = ();
383-
type ItemData = ();
382+
type ViewQuery = ();
383+
type ItemQuery = ();
384384

385385
#[inline]
386386
fn render<'w>(

crates/bevy_pbr/src/prepass/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -895,11 +895,11 @@ pub fn queue_prepass_material_meshes<M: Material>(
895895
pub struct SetPrepassViewBindGroup<const I: usize>;
896896
impl<P: PhaseItem, const I: usize> RenderCommand<P> for SetPrepassViewBindGroup<I> {
897897
type Param = SRes<PrepassViewBindGroup>;
898-
type ViewData = (
898+
type ViewQuery = (
899899
Read<ViewUniformOffset>,
900900
Option<Read<PreviousViewProjectionUniformOffset>>,
901901
);
902-
type ItemData = ();
902+
type ItemQuery = ();
903903

904904
#[inline]
905905
fn render<'w>(

crates/bevy_pbr/src/render/mesh.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,21 +1043,21 @@ pub fn prepare_mesh_bind_group(
10431043
pub struct SetMeshViewBindGroup<const I: usize>;
10441044
impl<P: PhaseItem, const I: usize> RenderCommand<P> for SetMeshViewBindGroup<I> {
10451045
type Param = ();
1046-
type ViewData = (
1046+
type ViewQuery = (
10471047
Read<ViewUniformOffset>,
10481048
Read<ViewLightsUniformOffset>,
10491049
Read<ViewFogUniformOffset>,
10501050
Read<ViewLightProbesUniformOffset>,
10511051
Read<MeshViewBindGroup>,
10521052
);
1053-
type ItemData = ();
1053+
type ItemQuery = ();
10541054

10551055
#[inline]
10561056
fn render<'w>(
10571057
_item: &P,
10581058
(view_uniform, view_lights, view_fog, view_light_probes, mesh_view_bind_group): ROQueryItem<
10591059
'w,
1060-
Self::ViewData,
1060+
Self::ViewQuery,
10611061
>,
10621062
_entity: (),
10631063
_: SystemParamItem<'w, '_, Self::Param>,
@@ -1087,8 +1087,8 @@ impl<P: PhaseItem, const I: usize> RenderCommand<P> for SetMeshBindGroup<I> {
10871087
SRes<MorphIndices>,
10881088
SRes<RenderLightmaps>,
10891089
);
1090-
type ViewData = ();
1091-
type ItemData = ();
1090+
type ViewQuery = ();
1091+
type ItemQuery = ();
10921092

10931093
#[inline]
10941094
fn render<'w>(
@@ -1157,8 +1157,8 @@ impl<P: PhaseItem, const I: usize> RenderCommand<P> for SetMeshBindGroup<I> {
11571157
pub struct DrawMesh;
11581158
impl<P: PhaseItem> RenderCommand<P> for DrawMesh {
11591159
type Param = (SRes<RenderAssets<Mesh>>, SRes<RenderMeshInstances>);
1160-
type ViewData = ();
1161-
type ItemData = ();
1160+
type ViewQuery = ();
1161+
type ItemQuery = ();
11621162
#[inline]
11631163
fn render<'w>(
11641164
item: &P,

0 commit comments

Comments
 (0)