Add debug log to image cache eviction
This commit is contained in:
parent
74c8641e2c
commit
59fe141efd
1 changed files with 12 additions and 9 deletions
|
|
@ -87,7 +87,7 @@ impl Cache {
|
||||||
|
|
||||||
let hits = &self.hits;
|
let hits = &self.hits;
|
||||||
|
|
||||||
self.map.retain(|k, memory| {
|
self.map.retain(|id, memory| {
|
||||||
// Retain active allocations
|
// Retain active allocations
|
||||||
if let Memory::Device { allocation, .. } = memory
|
if let Memory::Device { allocation, .. } = memory
|
||||||
&& allocation
|
&& allocation
|
||||||
|
|
@ -97,17 +97,20 @@ impl Cache {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let retain = hits.contains(k);
|
let retain = hits.contains(id);
|
||||||
|
|
||||||
if !retain
|
if !retain {
|
||||||
&& let Memory::Device {
|
log::debug!("Dropping image allocation: {id:?}");
|
||||||
|
|
||||||
|
if let Memory::Device {
|
||||||
entry, bind_group, ..
|
entry, bind_group, ..
|
||||||
} = memory
|
} = memory
|
||||||
{
|
{
|
||||||
if let Some(bind_group) = bind_group.take() {
|
if let Some(bind_group) = bind_group.take() {
|
||||||
on_drop(bind_group);
|
on_drop(bind_group);
|
||||||
} else {
|
} else {
|
||||||
atlas.remove(entry);
|
atlas.remove(entry);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue