From 8e783d347fcca20ed6e350b449cd8751bf2ffcf6 Mon Sep 17 00:00:00 2001 From: Robert Swain Date: Mon, 17 Feb 2025 20:31:56 +0100 Subject: [PATCH] Sweep old entities from 2D binned render phases (#17903) # Objective - #17787 removed sweeping of binned render phases from 2D by accident due to them not using the `BinnedRenderPhasePlugin`. - Fixes #17885 ## Solution - Schedule `sweep_old_entities` in `QueueSweep` like `BinnedRenderPhasePlugin` does, but for 2D where that plugin is not used. ## Testing Tested with the modified `shader_defs` example in #17885 . --- crates/bevy_sprite/src/mesh2d/mesh.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/bevy_sprite/src/mesh2d/mesh.rs b/crates/bevy_sprite/src/mesh2d/mesh.rs index 5d61b87907..a39c6ff2be 100644 --- a/crates/bevy_sprite/src/mesh2d/mesh.rs +++ b/crates/bevy_sprite/src/mesh2d/mesh.rs @@ -1,6 +1,6 @@ use bevy_app::Plugin; use bevy_asset::{load_internal_asset, weak_handle, AssetId, Handle}; -use bevy_render::render_phase::InputUniformIndex; +use bevy_render::render_phase::{sweep_old_entities, InputUniformIndex}; use crate::{tonemapping_pipeline_key, Material2dBindGroupId}; use bevy_core_pipeline::tonemapping::DebandDither; @@ -115,6 +115,11 @@ impl Plugin for Mesh2dRenderPlugin { .add_systems( Render, ( + ( + sweep_old_entities::, + sweep_old_entities::, + ) + .in_set(RenderSet::QueueSweep), batch_and_prepare_binned_render_phase:: .in_set(RenderSet::PrepareResources), batch_and_prepare_binned_render_phase::