diff --git a/crates/bevy_pbr/src/material.rs b/crates/bevy_pbr/src/material.rs index 181499618418e..26616466446f1 100644 --- a/crates/bevy_pbr/src/material.rs +++ b/crates/bevy_pbr/src/material.rs @@ -8,7 +8,7 @@ use crate::meshlet::{ }; use crate::*; use bevy_asset::prelude::AssetChanged; -use bevy_asset::{Asset, AssetEvents, AssetId, AssetServer, UntypedAssetId}; +use bevy_asset::{Asset, AssetId, AssetServer, UntypedAssetId}; use bevy_core_pipeline::deferred::{AlphaMask3dDeferred, Opaque3dDeferred}; use bevy_core_pipeline::prepass::{AlphaMask3dPrepass, Opaque3dPrepass}; use bevy_core_pipeline::{ @@ -286,12 +286,11 @@ where .add_plugins((RenderAssetPlugin::>::default(),)) .add_systems( PostUpdate, - ( - mark_meshes_as_changed_if_their_materials_changed::.ambiguous_with_all(), - check_entities_needing_specialization::.after(AssetEvents), - ) + mark_meshes_as_changed_if_their_materials_changed:: + .ambiguous_with_all() .after(mark_3d_meshes_as_changed_if_their_assets_changed), - ); + ) + .add_systems(Last, check_entities_needing_specialization::); if self.shadows_enabled { app.add_systems( diff --git a/crates/bevy_sprite/src/mesh2d/material.rs b/crates/bevy_sprite/src/mesh2d/material.rs index e34595f138eb5..8f187753b010f 100644 --- a/crates/bevy_sprite/src/mesh2d/material.rs +++ b/crates/bevy_sprite/src/mesh2d/material.rs @@ -2,9 +2,9 @@ use crate::{ DrawMesh2d, Mesh2d, Mesh2dPipeline, Mesh2dPipelineKey, RenderMesh2dInstances, SetMesh2dBindGroup, SetMesh2dViewBindGroup, ViewKeyCache, ViewSpecializationTicks, }; -use bevy_app::{App, Plugin, PostUpdate}; +use bevy_app::{App, Last, Plugin}; use bevy_asset::prelude::AssetChanged; -use bevy_asset::{AsAssetId, Asset, AssetApp, AssetEvents, AssetId, AssetServer, Handle}; +use bevy_asset::{AsAssetId, Asset, AssetApp, AssetId, AssetServer, Handle}; use bevy_core_pipeline::{ core_2d::{ AlphaMask2d, AlphaMask2dBinKey, BatchSetKey2d, Opaque2d, Opaque2dBinKey, Transparent2d, @@ -271,10 +271,7 @@ where .init_resource::>() .register_type::>() .add_plugins(RenderAssetPlugin::>::default()) - .add_systems( - PostUpdate, - check_entities_needing_specialization::.after(AssetEvents), - ); + .add_systems(Last, check_entities_needing_specialization::); if let Some(render_app) = app.get_sub_app_mut(RenderApp) { render_app