Make image Cache eviction strategy less aggressive in iced_wgpu

Instead of trimming unconditionally at the end of
a frame, we now trim the cache only when there is a
cache miss.

This way, images that are not visible but still a
part of the layout will stay cached. Eviction will
only happen when the images are not a part of the
UI for two consectuive frames.
This commit is contained in:
Héctor Ramón Jiménez 2024-04-24 21:29:30 +02:00
parent fdcec03197
commit 493c36ac71
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
6 changed files with 41 additions and 5 deletions

View file

@ -277,7 +277,7 @@ impl Pipeline {
let texture_version = cache.layer_count();
if self.texture_version != texture_version {
log::info!("Atlas has grown. Recreating bind group...");
log::debug!("Atlas has grown. Recreating bind group...");
self.texture =
cache.create_bind_group(device, &self.texture_layout);