Vulkan: Free texture slabs on exit.

This commit is contained in:
Unknown W. Brackets 2016-03-26 20:19:58 -07:00
parent 16570f10bd
commit 3352608027
2 changed files with 8 additions and 1 deletions

View File

@ -113,7 +113,13 @@ VulkanDeviceAllocator::~VulkanDeviceAllocator() {
void VulkanDeviceAllocator::Destroy() {
for (Slab &slab : slabs_) {
// Did anyone forget to free?
assert(slab.allocSizes.empty());
for (auto pair : slab.allocSizes) {
if (slab.usage[pair.first] != 2) {
// If it's not 2 (queued), there's a problem.
// If it's zero, it means allocSizes is somehow out of sync.
Crash();
}
}
vulkan_->Delete().QueueDeleteDeviceMemory(slab.deviceMemory);
}

View File

@ -149,6 +149,7 @@ TextureCacheVulkan::TextureCacheVulkan(VulkanContext *vulkan)
TextureCacheVulkan::~TextureCacheVulkan() {
Clear(true);
allocator_->Destroy();
}
void TextureCacheVulkan::DownloadFramebufferForClut(u32 clutAddr, u32 bytes) {