Debug visualization for the Vulkan memory allocator. Shows some interesting behaviour.

This commit is contained in:
Henrik Rydgård
2018-01-29 19:38:10 +01:00
parent 2ae2dd7d40
commit c60c8ed68a
18 changed files with 168 additions and 15 deletions
+7
View File
@@ -293,6 +293,13 @@ int VulkanDeviceAllocator::ComputeUsagePercent() const {
return blockSum == 0 ? 0 : 100 * blocksUsed / blockSum;
}
std::vector<uint8_t> VulkanDeviceAllocator::GetSlabUsage(int slabIndex) const {
if (slabIndex < 0 || slabIndex >= (int)slabs_.size())
return std::vector<uint8_t>();
const Slab &slab = slabs_[slabIndex];
return slab.usage;
}
void VulkanDeviceAllocator::Free(VkDeviceMemory deviceMemory, size_t offset) {
assert(!destroyed_);