mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
unload unused images that are RenderAssetUsages::RENDER_WORLD (#13609)
# Objective - Fixes #13500 - Images that are `RenderAssetUsages::RENDER_WORLD` don't free their memory when they are no longer used ## Solution - Remove their bind group when the handles are unused
This commit is contained in:
parent
be053b1d7c
commit
ce46d52536
1 changed files with 1 additions and 2 deletions
|
@ -605,10 +605,9 @@ pub fn prepare_sprite_image_bind_groups(
|
|||
for event in &events.images {
|
||||
match event {
|
||||
AssetEvent::Added { .. } |
|
||||
AssetEvent::Unused { .. } |
|
||||
// Images don't have dependencies
|
||||
AssetEvent::LoadedWithDependencies { .. } => {}
|
||||
AssetEvent::Modified { id } | AssetEvent::Removed { id } => {
|
||||
AssetEvent::Unused { id } | AssetEvent::Modified { id } | AssetEvent::Removed { id } => {
|
||||
image_bind_groups.values.remove(id);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue