diff --git a/crates/bevy_pbr/src/material.rs b/crates/bevy_pbr/src/material.rs index cc3a69a0ad..2e642dba92 100644 --- a/crates/bevy_pbr/src/material.rs +++ b/crates/bevy_pbr/src/material.rs @@ -746,11 +746,11 @@ fn early_sweep_material_instances( /// preparation for a new frame. pub(crate) fn late_sweep_material_instances( mut material_instances: ResMut, - mut removed_visibilities_query: Extract>, + mut removed_meshes_query: Extract>, ) { let last_change_tick = material_instances.current_change_tick; - for entity in removed_visibilities_query.read() { + for entity in removed_meshes_query.read() { if let Entry::Occupied(occupied_entry) = material_instances.instances.entry(entity.into()) { // Only sweep the entry if it wasn't updated this frame. It's // possible that a `ViewVisibility` component was removed and diff --git a/crates/bevy_pbr/src/render/mesh.rs b/crates/bevy_pbr/src/render/mesh.rs index 2e9562c5f8..53b3b4129a 100644 --- a/crates/bevy_pbr/src/render/mesh.rs +++ b/crates/bevy_pbr/src/render/mesh.rs @@ -1452,8 +1452,6 @@ pub fn extract_meshes_for_gpu_building( >, >, all_meshes_query: Extract>, - mut removed_visibilities_query: Extract>, - mut removed_global_transforms_query: Extract>, mut removed_meshes_query: Extract>, gpu_culling_query: Extract, Without)>>, meshes_to_reextract_next_frame: ResMut, @@ -1509,11 +1507,7 @@ pub fn extract_meshes_for_gpu_building( } // Also record info about each mesh that became invisible. - for entity in removed_visibilities_query - .read() - .chain(removed_global_transforms_query.read()) - .chain(removed_meshes_query.read()) - { + for entity in removed_meshes_query.read() { // Only queue a mesh for removal if we didn't pick it up above. // It's possible that a necessary component was removed and re-added in // the same frame. diff --git a/crates/bevy_pbr/src/render/skin.rs b/crates/bevy_pbr/src/render/skin.rs index f9ec672a66..ca035c980a 100644 --- a/crates/bevy_pbr/src/render/skin.rs +++ b/crates/bevy_pbr/src/render/skin.rs @@ -309,7 +309,6 @@ pub fn extract_skins( skinned_mesh_inverse_bindposes: Extract>>, changed_transforms: Extract>>, joints: Extract>, - mut removed_visibilities_query: Extract>, mut removed_skinned_meshes_query: Extract>, ) { let skin_uniforms = skin_uniforms.into_inner(); @@ -335,10 +334,7 @@ pub fn extract_skins( ); // Delete skins that became invisible. - for skinned_mesh_entity in removed_visibilities_query - .read() - .chain(removed_skinned_meshes_query.read()) - { + for skinned_mesh_entity in removed_skinned_meshes_query.read() { // Only remove a skin if we didn't pick it up in `add_or_delete_skins`. // It's possible that a necessary component was removed and re-added in // the same frame. diff --git a/crates/bevy_sprite/src/mesh2d/material.rs b/crates/bevy_sprite/src/mesh2d/material.rs index 06914690ca..4117e39823 100644 --- a/crates/bevy_sprite/src/mesh2d/material.rs +++ b/crates/bevy_sprite/src/mesh2d/material.rs @@ -331,7 +331,6 @@ pub fn extract_mesh_materials_2d( Or<(Changed, Changed>)>, >, >, - mut removed_visibilities_query: Extract>, mut removed_materials_query: Extract>>, ) { for (entity, view_visibility, material) in &changed_meshes_query { @@ -342,10 +341,7 @@ pub fn extract_mesh_materials_2d( } } - for entity in removed_visibilities_query - .read() - .chain(removed_materials_query.read()) - { + for entity in removed_materials_query.read() { // Only queue a mesh for removal if we didn't pick it up above. // It's possible that a necessary component was removed and re-added in // the same frame.