Skip to content

Commit

Permalink
Don’t prepare 2D view bind groups for 3D cameras (#14481)
Browse files Browse the repository at this point in the history
# 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.
  • Loading branch information
brianreavis authored Jul 25, 2024
1 parent 5aa998d commit 4382170
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_sprite/src/mesh2d/mesh.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use bevy_app::Plugin;
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::{
get_lut_bind_group_layout_entries, get_lut_bindings, Tonemapping, TonemappingLuts,
};
Expand Down Expand Up @@ -611,7 +611,7 @@ pub fn prepare_mesh2d_view_bind_groups(
render_device: Res<RenderDevice>,
mesh2d_pipeline: Res<Mesh2dPipeline>,
view_uniforms: Res<ViewUniforms>,
views: Query<(Entity, &Tonemapping), With<ExtractedView>>,
views: Query<(Entity, &Tonemapping), (With<ExtractedView>, With<Camera2d>)>,
globals_buffer: Res<GlobalsBuffer>,
tonemapping_luts: Res<TonemappingLuts>,
images: Res<RenderAssets<GpuImage>>,
Expand Down

0 comments on commit 4382170

Please sign in to comment.