Track async mapping properly

This commit is contained in:
Dzmitry Malyshau committed 2019-04-22 13:57:35 -04:00
1 parent f5ad76726b
commit 1f4d67aeb2
5 files changed
+94 -53

No files matched your search

+13
View File
@@ -131,4 +131,17 @@ impl<B: hal::Backend> CommandAllocator<B> {
}
}
}
pub fn destroy(self, device: &B::Device) {
let mut inner = self.inner.lock();
while let Some(cmd_buf) = inner.pending.pop() {
inner.recycle(cmd_buf);
}
for (_, mut pool) in inner.pools.drain() {
unsafe {
pool.raw.free(pool.available);
device.destroy_command_pool(pool.raw);
}
}
}
}