Don’t prepare 2D view bind groups for 3D cameras (#14481)

# Objective

- Before this fix, the view query in `prepare_mesh2d_view_bind_groups`
matched all views – leading to 2D view bind groups being prepared for 3D
cameras.

## Solution

- Added `With<Camera2d>` to the views query.

## Testing

- Verified the examples still work.
This commit is contained in:
Brian Reavis 2024-07-25 13:37:54 -07:00 committed by GitHub
parent 5aa998dc07
commit 438217035d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,7 +1,7 @@
use bevy_app::Plugin; use bevy_app::Plugin;
use bevy_asset::{load_internal_asset, AssetId, Handle}; use bevy_asset::{load_internal_asset, AssetId, Handle};
use bevy_core_pipeline::core_2d::Transparent2d; use bevy_core_pipeline::core_2d::{Camera2d, Transparent2d};
use bevy_core_pipeline::tonemapping::{ use bevy_core_pipeline::tonemapping::{
get_lut_bind_group_layout_entries, get_lut_bindings, Tonemapping, TonemappingLuts, get_lut_bind_group_layout_entries, get_lut_bindings, Tonemapping, TonemappingLuts,
}; };
@ -611,7 +611,7 @@ pub fn prepare_mesh2d_view_bind_groups(
render_device: Res<RenderDevice>, render_device: Res<RenderDevice>,
mesh2d_pipeline: Res<Mesh2dPipeline>, mesh2d_pipeline: Res<Mesh2dPipeline>,
view_uniforms: Res<ViewUniforms>, view_uniforms: Res<ViewUniforms>,
views: Query<(Entity, &Tonemapping), With<ExtractedView>>, views: Query<(Entity, &Tonemapping), (With<ExtractedView>, With<Camera2d>)>,
globals_buffer: Res<GlobalsBuffer>, globals_buffer: Res<GlobalsBuffer>,
tonemapping_luts: Res<TonemappingLuts>, tonemapping_luts: Res<TonemappingLuts>,
images: Res<RenderAssets<GpuImage>>, images: Res<RenderAssets<GpuImage>>,