Implemented automatic deallocation of texture space for dropped allocations
This commit is contained in:
parent
8f9f44b9e8
commit
4617da2818
3 changed files with 88 additions and 85 deletions
|
|
@ -130,16 +130,10 @@ impl Cache {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn trim(&mut self, texture_array: &mut TextureArray) {
|
||||
pub fn trim(&mut self) {
|
||||
let svg_hits = &self.svg_hits;
|
||||
let rasterized_hits = &self.rasterized_hits;
|
||||
|
||||
for (k, allocation) in &self.rasterized {
|
||||
if !rasterized_hits.contains(k) {
|
||||
texture_array.deallocate(allocation);
|
||||
}
|
||||
}
|
||||
|
||||
self.svgs.retain(|k, _| svg_hits.contains(k));
|
||||
self.rasterized.retain(|k, _| rasterized_hits.contains(k));
|
||||
self.svg_hits.clear();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue