mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-01 18:23:43 +01:00
Vulkan: Decimate the texture allocator.
Thin3D wasn't calling Begin/End, which lead to leaks eventually and OOM. Was causing softgpu to crash.
This commit is contained in:
1 parent
7f4da9b567
commit
a7b3a1eb96
3 files changed
+7
-5
No files matched your search
@@ -157,7 +157,7 @@ void VulkanPushBuffer::Unmap() {
|
||||
}
|
||||
|
||||
VulkanDeviceAllocator::VulkanDeviceAllocator(VulkanContext *vulkan, size_t minSlabSize, size_t maxSlabSize)
|
||||
: vulkan_(vulkan), lastSlab_(0), minSlabSize_(minSlabSize), maxSlabSize_(maxSlabSize), memoryTypeIndex_(UNDEFINED_MEMORY_TYPE), destroyed_(false) {
|
||||
: vulkan_(vulkan), minSlabSize_(minSlabSize), maxSlabSize_(maxSlabSize) {
|
||||
assert((minSlabSize_ & (SLAB_GRAIN_SIZE - 1)) == 0);
|
||||
}
|
||||
|
||||
@@ -290,7 +290,7 @@ int VulkanDeviceAllocator::ComputeUsagePercent() const {
|
||||
blocksUsed += slabs_[i].usage[j] != 0 ? 1 : 0;
|
||||
}
|
||||
}
|
||||
return 100 * blocksUsed / blockSum;
|
||||
return blockSum == 0 ? 0 : 100 * blocksUsed / blockSum;
|
||||
}
|
||||
|
||||
void VulkanDeviceAllocator::Free(VkDeviceMemory deviceMemory, size_t offset) {
|
||||
|
||||
Reference in new issue
Block a user