diff --git a/crates/bevy_core_pipeline/src/bloom/mod.rs b/crates/bevy_core_pipeline/src/bloom/mod.rs index f9adf440f85ab..85f3e93ff1be1 100644 --- a/crates/bevy_core_pipeline/src/bloom/mod.rs +++ b/crates/bevy_core_pipeline/src/bloom/mod.rs @@ -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, @@ -140,7 +140,7 @@ impl ViewNode for BloomNode { bloom_settings, upsampling_pipeline_ids, downsampling_pipeline_ids, - ): QueryItem, + ): QueryItem, world: &World, ) -> Result<(), NodeRunError> { let downsampling_pipeline_res = world.resource::(); diff --git a/crates/bevy_core_pipeline/src/bloom/settings.rs b/crates/bevy_core_pipeline/src/bloom/settings.rs index a5514a9f9665b..69c789933c686 100644 --- a/crates/bevy_core_pipeline/src/bloom/settings.rs +++ b/crates/bevy_core_pipeline/src/bloom/settings.rs @@ -182,12 +182,12 @@ pub enum BloomCompositeMode { } impl ExtractComponent for BloomSettings { - type Data = (&'static Self, &'static Camera); + type QueryData = (&'static Self, &'static Camera); - type Filter = (); + type QueryFilter = (); type Out = (Self, BloomUniforms); - fn extract_component((settings, camera): QueryItem<'_, Self::Data>) -> Option { + fn extract_component((settings, camera): QueryItem<'_, Self::QueryData>) -> Option { match ( camera.physical_viewport_rect(), camera.physical_viewport_size(), diff --git a/crates/bevy_core_pipeline/src/contrast_adaptive_sharpening/mod.rs b/crates/bevy_core_pipeline/src/contrast_adaptive_sharpening/mod.rs index af51d695eafa2..6e512b873572a 100644 --- a/crates/bevy_core_pipeline/src/contrast_adaptive_sharpening/mod.rs +++ b/crates/bevy_core_pipeline/src/contrast_adaptive_sharpening/mod.rs @@ -77,11 +77,11 @@ pub struct CASUniform { } impl ExtractComponent for ContrastAdaptiveSharpeningSettings { - type Data = &'static Self; - type Filter = With; + type QueryData = &'static Self; + type QueryFilter = With; type Out = (DenoiseCAS, CASUniform); - fn extract_component(item: QueryItem) -> Option { + fn extract_component(item: QueryItem) -> Option { if !item.enabled || item.sharpening_strength == 0.0 { return None; } diff --git a/crates/bevy_core_pipeline/src/core_3d/main_opaque_pass_3d_node.rs b/crates/bevy_core_pipeline/src/core_3d/main_opaque_pass_3d_node.rs index 82ce6d9858fab..804f6afcf8e18 100644 --- a/crates/bevy_core_pipeline/src/core_3d/main_opaque_pass_3d_node.rs +++ b/crates/bevy_core_pipeline/src/core_3d/main_opaque_pass_3d_node.rs @@ -20,7 +20,7 @@ use super::AlphaMask3d; #[derive(Default)] pub struct MainOpaquePass3dNode; impl ViewNode for MainOpaquePass3dNode { - type ViewData = ( + type ViewQuery = ( &'static ExtractedCamera, &'static RenderPhase, &'static RenderPhase, @@ -44,7 +44,7 @@ impl ViewNode for MainOpaquePass3dNode { skybox_pipeline, skybox_bind_group, view_uniform_offset, - ): QueryItem, + ): QueryItem, world: &World, ) -> Result<(), NodeRunError> { // Run the opaque pass, sorted front-to-back diff --git a/crates/bevy_core_pipeline/src/core_3d/main_transmissive_pass_3d_node.rs b/crates/bevy_core_pipeline/src/core_3d/main_transmissive_pass_3d_node.rs index 99ed34397e9cc..73a679ba047eb 100644 --- a/crates/bevy_core_pipeline/src/core_3d/main_transmissive_pass_3d_node.rs +++ b/crates/bevy_core_pipeline/src/core_3d/main_transmissive_pass_3d_node.rs @@ -18,7 +18,7 @@ use std::ops::Range; pub struct MainTransmissivePass3dNode; impl ViewNode for MainTransmissivePass3dNode { - type ViewData = ( + type ViewQuery = ( &'static ExtractedCamera, &'static Camera3d, &'static RenderPhase, @@ -32,7 +32,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> { diff --git a/crates/bevy_core_pipeline/src/core_3d/main_transparent_pass_3d_node.rs b/crates/bevy_core_pipeline/src/core_3d/main_transparent_pass_3d_node.rs index ba379edb0dcdf..1ffb059007c8f 100644 --- a/crates/bevy_core_pipeline/src/core_3d/main_transparent_pass_3d_node.rs +++ b/crates/bevy_core_pipeline/src/core_3d/main_transparent_pass_3d_node.rs @@ -16,7 +16,7 @@ use bevy_utils::tracing::info_span; pub struct MainTransparentPass3dNode; impl ViewNode for MainTransparentPass3dNode { - type ViewData = ( + type ViewQuery = ( &'static ExtractedCamera, &'static RenderPhase, &'static ViewTarget, @@ -26,7 +26,7 @@ impl ViewNode for MainTransparentPass3dNode { &self, graph: &mut RenderGraphContext, render_context: &mut RenderContext, - (camera, transparent_phase, target, depth): QueryItem, + (camera, transparent_phase, target, depth): QueryItem, world: &World, ) -> Result<(), NodeRunError> { let view_entity = graph.view_entity(); diff --git a/crates/bevy_core_pipeline/src/deferred/copy_lighting_id.rs b/crates/bevy_core_pipeline/src/deferred/copy_lighting_id.rs index 71670b40b3cbd..62ca382d05198 100644 --- a/crates/bevy_core_pipeline/src/deferred/copy_lighting_id.rs +++ b/crates/bevy_core_pipeline/src/deferred/copy_lighting_id.rs @@ -61,7 +61,7 @@ impl CopyDeferredLightingIdNode { } impl ViewNode for CopyDeferredLightingIdNode { - type ViewData = ( + type ViewQuery = ( &'static ViewTarget, &'static ViewPrepassTextures, &'static DeferredLightingIdDepthTexture, @@ -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> { diff --git a/crates/bevy_core_pipeline/src/deferred/node.rs b/crates/bevy_core_pipeline/src/deferred/node.rs index 8fac4d77fb32f..e685090437ca1 100644 --- a/crates/bevy_core_pipeline/src/deferred/node.rs +++ b/crates/bevy_core_pipeline/src/deferred/node.rs @@ -26,7 +26,7 @@ use super::{AlphaMask3dDeferred, Opaque3dDeferred}; pub struct DeferredGBufferPrepassNode; impl ViewNode for DeferredGBufferPrepassNode { - type ViewData = ( + type ViewQuery = ( &'static ExtractedCamera, &'static RenderPhase, &'static RenderPhase, @@ -44,7 +44,7 @@ impl ViewNode for DeferredGBufferPrepassNode { alpha_mask_deferred_phase, view_depth_texture, view_prepass_textures, - ): QueryItem, + ): QueryItem, world: &World, ) -> Result<(), NodeRunError> { let view_entity = graph.view_entity(); diff --git a/crates/bevy_core_pipeline/src/fxaa/node.rs b/crates/bevy_core_pipeline/src/fxaa/node.rs index 954a8975d52be..9c920d5d59f98 100644 --- a/crates/bevy_core_pipeline/src/fxaa/node.rs +++ b/crates/bevy_core_pipeline/src/fxaa/node.rs @@ -20,7 +20,7 @@ pub struct FxaaNode { } impl ViewNode for FxaaNode { - type ViewData = ( + type ViewQuery = ( &'static ViewTarget, &'static CameraFxaaPipeline, &'static Fxaa, @@ -30,7 +30,7 @@ impl ViewNode for FxaaNode { &self, _graph: &mut RenderGraphContext, render_context: &mut RenderContext, - (target, pipeline, fxaa): QueryItem, + (target, pipeline, fxaa): QueryItem, world: &World, ) -> Result<(), NodeRunError> { let pipeline_cache = world.resource::(); diff --git a/crates/bevy_core_pipeline/src/prepass/node.rs b/crates/bevy_core_pipeline/src/prepass/node.rs index c37af2110a360..baaed25bd2871 100644 --- a/crates/bevy_core_pipeline/src/prepass/node.rs +++ b/crates/bevy_core_pipeline/src/prepass/node.rs @@ -22,7 +22,7 @@ use super::{AlphaMask3dPrepass, DeferredPrepass, Opaque3dPrepass, ViewPrepassTex pub struct PrepassNode; impl ViewNode for PrepassNode { - type ViewData = ( + type ViewQuery = ( &'static ExtractedCamera, &'static RenderPhase, &'static RenderPhase, @@ -42,7 +42,7 @@ impl ViewNode for PrepassNode { view_depth_texture, view_prepass_textures, deferred_prepass, - ): QueryItem, + ): QueryItem, world: &World, ) -> Result<(), NodeRunError> { let view_entity = graph.view_entity(); diff --git a/crates/bevy_core_pipeline/src/skybox/mod.rs b/crates/bevy_core_pipeline/src/skybox/mod.rs index c12b25351968c..ad0794f4ee568 100644 --- a/crates/bevy_core_pipeline/src/skybox/mod.rs +++ b/crates/bevy_core_pipeline/src/skybox/mod.rs @@ -80,12 +80,12 @@ pub struct Skybox { } impl ExtractComponent for Skybox { - type Data = (&'static Self, Option<&'static ExposureSettings>); - type Filter = (); + type QueryData = (&'static Self, Option<&'static ExposureSettings>); + type QueryFilter = (); type Out = (Self, SkyboxUniforms); fn extract_component( - (skybox, exposure_settings): QueryItem<'_, Self::Data>, + (skybox, exposure_settings): QueryItem<'_, Self::QueryData>, ) -> Option { let exposure = exposure_settings .map(|e| e.exposure()) diff --git a/crates/bevy_core_pipeline/src/taa/mod.rs b/crates/bevy_core_pipeline/src/taa/mod.rs index f322571d0c6b6..b0eb4f3057e69 100644 --- a/crates/bevy_core_pipeline/src/taa/mod.rs +++ b/crates/bevy_core_pipeline/src/taa/mod.rs @@ -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, @@ -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> { diff --git a/crates/bevy_core_pipeline/src/tonemapping/node.rs b/crates/bevy_core_pipeline/src/tonemapping/node.rs index 49b6959b3c92a..08084592c013d 100644 --- a/crates/bevy_core_pipeline/src/tonemapping/node.rs +++ b/crates/bevy_core_pipeline/src/tonemapping/node.rs @@ -24,7 +24,7 @@ pub struct TonemappingNode { } impl ViewNode for TonemappingNode { - type ViewData = ( + type ViewQuery = ( &'static ViewUniformOffset, &'static ViewTarget, &'static ViewTonemappingPipeline, @@ -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> { diff --git a/crates/bevy_core_pipeline/src/upscaling/node.rs b/crates/bevy_core_pipeline/src/upscaling/node.rs index 5192e87f47f0d..16e277aeb0870 100644 --- a/crates/bevy_core_pipeline/src/upscaling/node.rs +++ b/crates/bevy_core_pipeline/src/upscaling/node.rs @@ -18,7 +18,7 @@ pub struct UpscalingNode { } impl ViewNode for UpscalingNode { - type ViewData = ( + type ViewQuery = ( &'static ViewTarget, &'static ViewUpscalingPipeline, Option<&'static ExtractedCamera>, @@ -28,7 +28,7 @@ impl ViewNode for UpscalingNode { &self, _graph: &mut RenderGraphContext, render_context: &mut RenderContext, - (target, upscaling_target, camera): QueryItem, + (target, upscaling_target, camera): QueryItem, world: &World, ) -> Result<(), NodeRunError> { let pipeline_cache = world.get_resource::().unwrap(); diff --git a/crates/bevy_gizmos/src/lib.rs b/crates/bevy_gizmos/src/lib.rs index 684c4ddd29c4e..8696477ac7e41 100644 --- a/crates/bevy_gizmos/src/lib.rs +++ b/crates/bevy_gizmos/src/lib.rs @@ -343,14 +343,14 @@ fn prepare_line_gizmo_bind_group( struct SetLineGizmoBindGroup; impl RenderCommand

for SetLineGizmoBindGroup { type Param = SRes; - type ViewData = (); - type ItemData = Read>; + type ViewQuery = (); + type ItemQuery = Read>; #[inline] fn render<'w>( _item: &P, - _view: ROQueryItem<'w, Self::ViewData>, - uniform_index: ROQueryItem<'w, Self::ItemData>, + _view: ROQueryItem<'w, Self::ViewQuery>, + uniform_index: ROQueryItem<'w, Self::ItemQuery>, bind_group: SystemParamItem<'w, '_, Self::Param>, pass: &mut TrackedRenderPass<'w>, ) -> RenderCommandResult { @@ -366,14 +366,14 @@ impl RenderCommand

for SetLineGizmoBindGroup struct DrawLineGizmo; impl RenderCommand

for DrawLineGizmo { type Param = SRes>; - type ViewData = (); - type ItemData = Read>; + type ViewQuery = (); + type ItemQuery = Read>; #[inline] fn render<'w>( _item: &P, - _view: ROQueryItem<'w, Self::ViewData>, - handle: ROQueryItem<'w, Self::ItemData>, + _view: ROQueryItem<'w, Self::ViewQuery>, + handle: ROQueryItem<'w, Self::ItemQuery>, line_gizmos: SystemParamItem<'w, '_, Self::Param>, pass: &mut TrackedRenderPass<'w>, ) -> RenderCommandResult { diff --git a/crates/bevy_pbr/src/deferred/mod.rs b/crates/bevy_pbr/src/deferred/mod.rs index cd9f45ba12f9c..d7d76b355b518 100644 --- a/crates/bevy_pbr/src/deferred/mod.rs +++ b/crates/bevy_pbr/src/deferred/mod.rs @@ -142,7 +142,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, @@ -166,7 +166,7 @@ impl ViewNode for DeferredOpaquePass3dPbrLightingNode { target, deferred_lighting_id_depth_texture, deferred_lighting_pipeline, - ): QueryItem, + ): QueryItem, world: &World, ) -> Result<(), NodeRunError> { let pipeline_cache = world.resource::(); diff --git a/crates/bevy_pbr/src/light_probe/environment_map.rs b/crates/bevy_pbr/src/light_probe/environment_map.rs index 0b355b666fcb1..6651d2412044b 100644 --- a/crates/bevy_pbr/src/light_probe/environment_map.rs +++ b/crates/bevy_pbr/src/light_probe/environment_map.rs @@ -185,11 +185,11 @@ pub(crate) enum RenderViewBindGroupEntries<'a> { } impl ExtractInstance for EnvironmentMapIds { - type Data = Read; + type QueryData = Read; - type Filter = (); + type QueryFilter = (); - fn extract(item: QueryItem<'_, Self::Data>) -> Option { + fn extract(item: QueryItem<'_, Self::QueryData>) -> Option { Some(EnvironmentMapIds { diffuse: item.diffuse_map.id(), specular: item.specular_map.id(), diff --git a/crates/bevy_pbr/src/material.rs b/crates/bevy_pbr/src/material.rs index 3af43aeda69d5..c002296ca0b4c 100644 --- a/crates/bevy_pbr/src/material.rs +++ b/crates/bevy_pbr/src/material.rs @@ -379,8 +379,8 @@ type DrawMaterial = ( pub struct SetMaterialBindGroup(PhantomData); impl RenderCommand

for SetMaterialBindGroup { type Param = (SRes>, SRes>); - type ViewData = (); - type ItemData = (); + type ViewQuery = (); + type ItemQuery = (); #[inline] fn render<'w>( diff --git a/crates/bevy_pbr/src/prepass/mod.rs b/crates/bevy_pbr/src/prepass/mod.rs index 6b05982f8942e..3ac2bee99e2ca 100644 --- a/crates/bevy_pbr/src/prepass/mod.rs +++ b/crates/bevy_pbr/src/prepass/mod.rs @@ -895,11 +895,11 @@ pub fn queue_prepass_material_meshes( pub struct SetPrepassViewBindGroup; impl RenderCommand

for SetPrepassViewBindGroup { type Param = SRes; - type ViewData = ( + type ViewQuery = ( Read, Option>, ); - type ItemData = (); + type ItemQuery = (); #[inline] fn render<'w>( diff --git a/crates/bevy_pbr/src/render/mesh.rs b/crates/bevy_pbr/src/render/mesh.rs index 03094f3b567b6..c905332b1fbb6 100644 --- a/crates/bevy_pbr/src/render/mesh.rs +++ b/crates/bevy_pbr/src/render/mesh.rs @@ -1043,21 +1043,21 @@ pub fn prepare_mesh_bind_group( pub struct SetMeshViewBindGroup; impl RenderCommand

for SetMeshViewBindGroup { type Param = (); - type ViewData = ( + type ViewQuery = ( Read, Read, Read, Read, Read, ); - type ItemData = (); + type ItemQuery = (); #[inline] fn render<'w>( _item: &P, (view_uniform, view_lights, view_fog, view_light_probes, mesh_view_bind_group): ROQueryItem< 'w, - Self::ViewData, + Self::ViewQuery, >, _entity: (), _: SystemParamItem<'w, '_, Self::Param>, @@ -1087,8 +1087,8 @@ impl RenderCommand

for SetMeshBindGroup { SRes, SRes, ); - type ViewData = (); - type ItemData = (); + type ViewQuery = (); + type ItemQuery = (); #[inline] fn render<'w>( @@ -1157,8 +1157,8 @@ impl RenderCommand

for SetMeshBindGroup { pub struct DrawMesh; impl RenderCommand

for DrawMesh { type Param = (SRes>, SRes); - type ViewData = (); - type ItemData = (); + type ViewQuery = (); + type ItemQuery = (); #[inline] fn render<'w>( item: &P, diff --git a/crates/bevy_pbr/src/ssao/mod.rs b/crates/bevy_pbr/src/ssao/mod.rs index cbcca32a23cf4..d9c9b8dc0fea1 100644 --- a/crates/bevy_pbr/src/ssao/mod.rs +++ b/crates/bevy_pbr/src/ssao/mod.rs @@ -199,7 +199,7 @@ impl ScreenSpaceAmbientOcclusionQualityLevel { struct SsaoNode {} impl ViewNode for SsaoNode { - type ViewData = ( + type ViewQuery = ( &'static ExtractedCamera, &'static SsaoPipelineId, &'static SsaoBindGroups, @@ -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, + (camera, pipeline_id, bind_groups, view_uniform_offset): QueryItem, world: &World, ) -> Result<(), NodeRunError> { let pipelines = world.resource::(); diff --git a/crates/bevy_render/macros/src/extract_component.rs b/crates/bevy_render/macros/src/extract_component.rs index 8e0f5f55860f4..80d1aa57ca5b5 100644 --- a/crates/bevy_render/macros/src/extract_component.rs +++ b/crates/bevy_render/macros/src/extract_component.rs @@ -38,12 +38,12 @@ pub fn derive_extract_component(input: TokenStream) -> TokenStream { TokenStream::from(quote! { impl #impl_generics #bevy_render_path::extract_component::ExtractComponent for #struct_name #type_generics #where_clause { - type Data = &'static Self; + type QueryData = &'static Self; - type Filter = #filter; + type QueryFilter = #filter; type Out = Self; - fn extract_component(item: #bevy_ecs_path::query::QueryItem<'_, Self::Data>) -> Option { + fn extract_component(item: #bevy_ecs_path::query::QueryItem<'_, Self::QueryData>) -> Option { Some(item.clone()) } } diff --git a/crates/bevy_render/src/extract_component.rs b/crates/bevy_render/src/extract_component.rs index 63ef625a170e3..98be77b2b9689 100644 --- a/crates/bevy_render/src/extract_component.rs +++ b/crates/bevy_render/src/extract_component.rs @@ -36,9 +36,9 @@ impl DynamicUniformIndex { /// in the [`ExtractSchedule`] step. pub trait ExtractComponent: Component { /// ECS [`ReadOnlyQueryData`] to fetch the components to extract. - type Data: ReadOnlyQueryData; + type QueryData: ReadOnlyQueryData; /// Filters the entities with additional constraints. - type Filter: QueryFilter; + type QueryFilter: QueryFilter; /// The output from extraction. /// @@ -58,7 +58,7 @@ pub trait ExtractComponent: Component { // type Out: Component = Self; /// Defines how the component is transferred into the "render world". - fn extract_component(item: QueryItem<'_, Self::Data>) -> Option; + fn extract_component(item: QueryItem<'_, Self::QueryData>) -> Option; } /// This plugin prepares the components of the corresponding type for the GPU @@ -195,12 +195,12 @@ impl Plugin for ExtractComponentPlugin { } impl ExtractComponent for Handle { - type Data = Read>; - type Filter = (); + type QueryData = Read>; + type QueryFilter = (); type Out = Handle; #[inline] - fn extract_component(handle: QueryItem<'_, Self::Data>) -> Option { + fn extract_component(handle: QueryItem<'_, Self::QueryData>) -> Option { Some(handle.clone_weak()) } } @@ -209,7 +209,7 @@ impl ExtractComponent for Handle { fn extract_components( mut commands: Commands, mut previous_len: Local, - query: Extract>, + query: Extract>, ) { let mut values = Vec::with_capacity(*previous_len); for (entity, query_item) in &query { @@ -225,7 +225,7 @@ fn extract_components( fn extract_visible_components( mut commands: Commands, mut previous_len: Local, - query: Extract>, + query: Extract>, ) { let mut values = Vec::with_capacity(*previous_len); for (entity, view_visibility, query_item) in &query { diff --git a/crates/bevy_render/src/extract_instances.rs b/crates/bevy_render/src/extract_instances.rs index 0b088e4607d7e..96fcfea7cb84e 100644 --- a/crates/bevy_render/src/extract_instances.rs +++ b/crates/bevy_render/src/extract_instances.rs @@ -29,12 +29,12 @@ use crate::{prelude::ViewVisibility, Extract, ExtractSchedule, RenderApp}; /// higher-performance because it avoids the ECS overhead. pub trait ExtractInstance: Send + Sync + Sized + 'static { /// ECS [`ReadOnlyQueryData`] to fetch the components to extract. - type Data: ReadOnlyQueryData; + type QueryData: ReadOnlyQueryData; /// Filters the entities with additional constraints. - type Filter: QueryFilter; + type QueryFilter: QueryFilter; /// Defines how the component is transferred into the "render world". - fn extract(item: QueryItem<'_, Self::Data>) -> Option; + fn extract(item: QueryItem<'_, Self::QueryData>) -> Option; } /// This plugin extracts one or more components into the "render world" as @@ -107,7 +107,7 @@ where fn extract_all( mut extracted_instances: ResMut>, - query: Extract>, + query: Extract>, ) where EI: ExtractInstance, { @@ -121,7 +121,7 @@ fn extract_all( fn extract_visible( mut extracted_instances: ResMut>, - query: Extract>, + query: Extract>, ) where EI: ExtractInstance, { @@ -139,10 +139,10 @@ impl ExtractInstance for AssetId where A: Asset, { - type Data = Read>; - type Filter = (); + type QueryData = Read>; + type QueryFilter = (); - fn extract(item: QueryItem<'_, Self::Data>) -> Option { + fn extract(item: QueryItem<'_, Self::QueryData>) -> Option { Some(item.id()) } } diff --git a/crates/bevy_render/src/render_graph/node.rs b/crates/bevy_render/src/render_graph/node.rs index 4d83dad643675..ef28794f9f49f 100644 --- a/crates/bevy_render/src/render_graph/node.rs +++ b/crates/bevy_render/src/render_graph/node.rs @@ -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) {} @@ -354,7 +354,7 @@ pub trait ViewNode { &self, graph: &mut RenderGraphContext, render_context: &mut RenderContext, - view_query: QueryItem, + view_query: QueryItem, world: &World, ) -> Result<(), NodeRunError>; } @@ -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 { - view_query: QueryState, + view_query: QueryState, node: N, } diff --git a/crates/bevy_render/src/render_phase/draw.rs b/crates/bevy_render/src/render_phase/draw.rs index 9837799fbcc3e..b293ca620c948 100644 --- a/crates/bevy_render/src/render_phase/draw.rs +++ b/crates/bevy_render/src/render_phase/draw.rs @@ -142,8 +142,8 @@ impl DrawFunctions

{ /// Compared to the draw function the required ECS data is fetched automatically /// (by the [`RenderCommandState`]) from the render world. /// Therefore the three types [`Param`](RenderCommand::Param), -/// [`ViewData`](RenderCommand::ViewData) and -/// [`ItemData`](RenderCommand::ItemData) are used. +/// [`ViewQuery`](RenderCommand::ViewQuery) and +/// [`ItemQuery`](RenderCommand::ItemQuery) are used. /// They specify which information is required to execute the render command. /// /// Multiple render commands can be combined together by wrapping them in a tuple. @@ -185,19 +185,19 @@ pub trait RenderCommand { /// The view entity refers to the camera, or shadow-casting light, etc. from which the phase /// item will be rendered from. /// All components have to be accessed read only. - type ViewData: ReadOnlyQueryData; + type ViewQuery: ReadOnlyQueryData; /// Specifies the ECS data of the item entity required by [`RenderCommand::render`]. /// /// The item is the entity that will be rendered for the corresponding view. /// All components have to be accessed read only. - type ItemData: ReadOnlyQueryData; + type ItemQuery: ReadOnlyQueryData; /// Renders a [`PhaseItem`] by recording commands (e.g. setting pipelines, binding bind groups, /// issuing draw calls, etc.) via the [`TrackedRenderPass`]. fn render<'w>( item: &P, - view: ROQueryItem<'w, Self::ViewData>, - entity: ROQueryItem<'w, Self::ItemData>, + view: ROQueryItem<'w, Self::ViewQuery>, + entity: ROQueryItem<'w, Self::ItemQuery>, param: SystemParamItem<'w, '_, Self::Param>, pass: &mut TrackedRenderPass<'w>, ) -> RenderCommandResult; @@ -213,14 +213,14 @@ macro_rules! render_command_tuple_impl { ($(($name: ident, $view: ident, $entity: ident)),*) => { impl),*> RenderCommand

for ($($name,)*) { type Param = ($($name::Param,)*); - type ViewData = ($($name::ViewData,)*); - type ItemData = ($($name::ItemData,)*); + type ViewQuery = ($($name::ViewQuery,)*); + type ItemQuery = ($($name::ItemQuery,)*); #[allow(non_snake_case)] fn render<'w>( _item: &P, - ($($view,)*): ROQueryItem<'w, Self::ViewData>, - ($($entity,)*): ROQueryItem<'w, Self::ItemData>, + ($($view,)*): ROQueryItem<'w, Self::ViewQuery>, + ($($entity,)*): ROQueryItem<'w, Self::ItemQuery>, ($($name,)*): SystemParamItem<'w, '_, Self::Param>, _pass: &mut TrackedRenderPass<'w>, ) -> RenderCommandResult { @@ -237,12 +237,12 @@ all_tuples!(render_command_tuple_impl, 0, 15, C, V, E); /// Wraps a [`RenderCommand`] into a state so that it can be used as a [`Draw`] function. /// -/// The [`RenderCommand::Param`], [`RenderCommand::ViewData`] and -/// [`RenderCommand::ItemData`] are fetched from the ECS and passed to the command. +/// The [`RenderCommand::Param`], [`RenderCommand::ViewQuery`] and +/// [`RenderCommand::ItemQuery`] are fetched from the ECS and passed to the command. pub struct RenderCommandState> { state: SystemState, - view: QueryState, - entity: QueryState, + view: QueryState, + entity: QueryState, } impl> RenderCommandState { diff --git a/crates/bevy_render/src/render_phase/mod.rs b/crates/bevy_render/src/render_phase/mod.rs index 5cf9976ec4d93..df804bfad10b9 100644 --- a/crates/bevy_render/src/render_phase/mod.rs +++ b/crates/bevy_render/src/render_phase/mod.rs @@ -196,8 +196,8 @@ pub struct SetItemPipeline; impl RenderCommand

for SetItemPipeline { type Param = SRes; - type ViewData = (); - type ItemData = (); + type ViewQuery = (); + type ItemQuery = (); #[inline] fn render<'w>( item: &P, diff --git a/crates/bevy_sprite/src/mesh2d/material.rs b/crates/bevy_sprite/src/mesh2d/material.rs index 702d9e7d7173c..07626d47a5c9f 100644 --- a/crates/bevy_sprite/src/mesh2d/material.rs +++ b/crates/bevy_sprite/src/mesh2d/material.rs @@ -330,8 +330,8 @@ impl RenderCommand

SRes>, SRes>, ); - type ViewData = (); - type ItemData = (); + type ViewQuery = (); + type ItemQuery = (); #[inline] fn render<'w>( diff --git a/crates/bevy_sprite/src/mesh2d/mesh.rs b/crates/bevy_sprite/src/mesh2d/mesh.rs index 9817e67f91cb5..4b9c9943dc793 100644 --- a/crates/bevy_sprite/src/mesh2d/mesh.rs +++ b/crates/bevy_sprite/src/mesh2d/mesh.rs @@ -613,13 +613,13 @@ pub fn prepare_mesh2d_view_bind_groups( pub struct SetMesh2dViewBindGroup; impl RenderCommand

for SetMesh2dViewBindGroup { type Param = (); - type ViewData = (Read, Read); - type ItemData = (); + type ViewQuery = (Read, Read); + type ItemQuery = (); #[inline] fn render<'w>( _item: &P, - (view_uniform, mesh2d_view_bind_group): ROQueryItem<'w, Self::ViewData>, + (view_uniform, mesh2d_view_bind_group): ROQueryItem<'w, Self::ViewQuery>, _view: (), _param: SystemParamItem<'w, '_, Self::Param>, pass: &mut TrackedRenderPass<'w>, @@ -633,8 +633,8 @@ impl RenderCommand

for SetMesh2dViewBindGroup; impl RenderCommand

for SetMesh2dBindGroup { type Param = SRes; - type ViewData = (); - type ItemData = (); + type ViewQuery = (); + type ItemQuery = (); #[inline] fn render<'w>( @@ -662,8 +662,8 @@ impl RenderCommand

for SetMesh2dBindGroup { pub struct DrawMesh2d; impl RenderCommand

for DrawMesh2d { type Param = (SRes>, SRes); - type ViewData = (); - type ItemData = (); + type ViewQuery = (); + type ItemQuery = (); #[inline] fn render<'w>( diff --git a/crates/bevy_sprite/src/render/mod.rs b/crates/bevy_sprite/src/render/mod.rs index 60c96584146e4..df319a7857e34 100644 --- a/crates/bevy_sprite/src/render/mod.rs +++ b/crates/bevy_sprite/src/render/mod.rs @@ -734,8 +734,8 @@ pub type DrawSprite = ( pub struct SetSpriteViewBindGroup; impl RenderCommand

for SetSpriteViewBindGroup { type Param = SRes; - type ViewData = Read; - type ItemData = (); + type ViewQuery = Read; + type ItemQuery = (); fn render<'w>( _item: &P, @@ -755,8 +755,8 @@ impl RenderCommand

for SetSpriteViewBindGroup; impl RenderCommand

for SetSpriteTextureBindGroup { type Param = SRes; - type ViewData = (); - type ItemData = Read; + type ViewQuery = (); + type ItemQuery = Read; fn render<'w>( _item: &P, @@ -782,8 +782,8 @@ impl RenderCommand

for SetSpriteTextureBindGrou pub struct DrawSpriteBatch; impl RenderCommand

for DrawSpriteBatch { type Param = SRes; - type ViewData = (); - type ItemData = Read; + type ViewQuery = (); + type ItemQuery = Read; fn render<'w>( _item: &P, diff --git a/crates/bevy_ui/src/render/render_pass.rs b/crates/bevy_ui/src/render/render_pass.rs index 0b993cd9fc79b..a38a14d234c1e 100644 --- a/crates/bevy_ui/src/render/render_pass.rs +++ b/crates/bevy_ui/src/render/render_pass.rs @@ -155,8 +155,8 @@ pub type DrawUi = ( pub struct SetUiViewBindGroup; impl RenderCommand

for SetUiViewBindGroup { type Param = SRes; - type ViewData = Read; - type ItemData = (); + type ViewQuery = Read; + type ItemQuery = (); fn render<'w>( _item: &P, @@ -176,8 +176,8 @@ impl RenderCommand

for SetUiViewBindGroup { pub struct SetUiTextureBindGroup; impl RenderCommand

for SetUiTextureBindGroup { type Param = SRes; - type ViewData = (); - type ItemData = Read; + type ViewQuery = (); + type ItemQuery = Read; #[inline] fn render<'w>( @@ -195,8 +195,8 @@ impl RenderCommand

for SetUiTextureBindGroup pub struct DrawUiNode; impl RenderCommand

for DrawUiNode { type Param = SRes; - type ViewData = (); - type ItemData = Read; + type ViewQuery = (); + type ItemQuery = Read; #[inline] fn render<'w>( diff --git a/crates/bevy_ui/src/render/ui_material_pipeline.rs b/crates/bevy_ui/src/render/ui_material_pipeline.rs index 9f17afc930ae6..2900560a6d059 100644 --- a/crates/bevy_ui/src/render/ui_material_pipeline.rs +++ b/crates/bevy_ui/src/render/ui_material_pipeline.rs @@ -263,8 +263,8 @@ pub type DrawUiMaterial = ( pub struct SetMatUiViewBindGroup(PhantomData); impl RenderCommand

for SetMatUiViewBindGroup { type Param = SRes>; - type ViewData = Read; - type ItemData = (); + type ViewQuery = Read; + type ItemQuery = (); fn render<'w>( _item: &P, @@ -287,13 +287,13 @@ impl RenderCommand

for SetUiMaterialBindGroup { type Param = SRes>; - type ViewData = (); - type ItemData = Read>; + type ViewQuery = (); + type ItemQuery = Read>; fn render<'w>( _item: &P, _view: (), - material_handle: ROQueryItem<'_, Self::ItemData>, + material_handle: ROQueryItem<'_, Self::ItemQuery>, materials: SystemParamItem<'w, '_, Self::Param>, pass: &mut TrackedRenderPass<'w>, ) -> RenderCommandResult { @@ -308,8 +308,8 @@ impl RenderCommand

pub struct DrawUiMaterialNode(PhantomData); impl RenderCommand

for DrawUiMaterialNode { type Param = SRes>; - type ViewData = (); - type ItemData = Read>; + type ViewQuery = (); + type ItemQuery = Read>; #[inline] fn render<'w>( diff --git a/examples/shader/post_processing.rs b/examples/shader/post_processing.rs index e266fa310d204..f2d15486b9e78 100644 --- a/examples/shader/post_processing.rs +++ b/examples/shader/post_processing.rs @@ -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, @@ -133,7 +133,7 @@ impl ViewNode for PostProcessNode { &self, _graph: &mut RenderGraphContext, render_context: &mut RenderContext, - (view_target, _post_process_settings): QueryItem, + (view_target, _post_process_settings): QueryItem, world: &World, ) -> Result<(), NodeRunError> { // Get the pipeline resource that contains the global data we need diff --git a/examples/shader/shader_instancing.rs b/examples/shader/shader_instancing.rs index 3a40d7fa694ea..8828a76aae0c6 100644 --- a/examples/shader/shader_instancing.rs +++ b/examples/shader/shader_instancing.rs @@ -68,11 +68,11 @@ fn setup(mut commands: Commands, mut meshes: ResMut>) { struct InstanceMaterialData(Vec); impl ExtractComponent for InstanceMaterialData { - type Data = &'static InstanceMaterialData; - type Filter = (); + type QueryData = &'static InstanceMaterialData; + type QueryFilter = (); type Out = Self; - fn extract_component(item: QueryItem<'_, Self::Data>) -> Option { + fn extract_component(item: QueryItem<'_, Self::QueryData>) -> Option { Some(InstanceMaterialData(item.0.clone())) } } @@ -237,8 +237,8 @@ pub struct DrawMeshInstanced; impl RenderCommand

for DrawMeshInstanced { type Param = (SRes>, SRes); - type ViewData = (); - type ItemData = Read; + type ViewQuery = (); + type ItemQuery = Read; #[inline] fn render<'w>(