summaryrefslogtreecommitdiffstats
path: root/wgpu/src/image/atlas.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2024-04-24 22:19:24 +0200
committerLibravatar GitHub <noreply@github.com>2024-04-24 22:19:24 +0200
commit5ef593ce53e0ba53d51809f198a02743f87a6ccd (patch)
tree9a19baac6fa56025a2aa29f3e5d77c7c98cec4b7 /wgpu/src/image/atlas.rs
parentfdcec0319757d2f87c82787eab34c6bef8c5a799 (diff)
parent493c36ac712ef04523065b94988a88cc4db16b1a (diff)
downloadiced-5ef593ce53e0ba53d51809f198a02743f87a6ccd.tar.gz
iced-5ef593ce53e0ba53d51809f198a02743f87a6ccd.tar.bz2
iced-5ef593ce53e0ba53d51809f198a02743f87a6ccd.zip
Merge pull request #2403 from iced-rs/improve-image-cache-eviction
Make image `Cache` eviction strategy less aggressive in `iced_wgpu`
Diffstat (limited to 'wgpu/src/image/atlas.rs')
-rw-r--r--wgpu/src/image/atlas.rs15
1 files changed, 11 insertions, 4 deletions
diff --git a/wgpu/src/image/atlas.rs b/wgpu/src/image/atlas.rs
index ea36e06d..ae43c3b4 100644
--- a/wgpu/src/image/atlas.rs
+++ b/wgpu/src/image/atlas.rs
@@ -94,7 +94,7 @@ impl Atlas {
entry
};
- log::info!("Allocated atlas entry: {entry:?}");
+ log::debug!("Allocated atlas entry: {entry:?}");
// It is a webgpu requirement that:
// BufferCopyView.layout.bytes_per_row % wgpu::COPY_BYTES_PER_ROW_ALIGNMENT == 0
@@ -147,13 +147,20 @@ impl Atlas {
}
}
- log::info!("Current atlas: {self:?}");
+ if log::log_enabled!(log::Level::Debug) {
+ log::debug!(
+ "Atlas layers: {} (busy: {}, allocations: {})",
+ self.layer_count(),
+ self.layers.iter().filter(|layer| !layer.is_empty()).count(),
+ self.layers.iter().map(Layer::allocations).sum::<usize>(),
+ );
+ }
Some(entry)
}
pub fn remove(&mut self, entry: &Entry) {
- log::info!("Removing atlas entry: {entry:?}");
+ log::debug!("Removing atlas entry: {entry:?}");
match entry {
Entry::Contiguous(allocation) => {
@@ -266,7 +273,7 @@ impl Atlas {
}
fn deallocate(&mut self, allocation: &Allocation) {
- log::info!("Deallocating atlas: {allocation:?}");
+ log::debug!("Deallocating atlas: {allocation:?}");
match allocation {
Allocation::Full { layer } => {