From 6a2f0f4191b5ba428bbaf34b95517f6e229f3ec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 3 Dec 2017 11:31:25 +0100 Subject: [PATCH] Revert "Fix memory-scan bug in VulkanDeviceAllocator that probably causes some fragmentation." This reverts commit ac6b4912870ab381619bf0ffa8cdc12766adf54d. --- Common/Vulkan/VulkanMemory.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Common/Vulkan/VulkanMemory.cpp b/Common/Vulkan/VulkanMemory.cpp index 5539f45286..be56e9b51a 100644 --- a/Common/Vulkan/VulkanMemory.cpp +++ b/Common/Vulkan/VulkanMemory.cpp @@ -246,16 +246,15 @@ bool VulkanDeviceAllocator::AllocateFromSlab(Slab &slab, size_t &start, size_t b return false; } - // Slow linear scan. for (size_t i = 0; i < blocks; ++i) { if (slab.usage[start + i]) { // If we just ran into one, there's probably an allocation size. auto it = slab.allocSizes.find(start + i); if (it != slab.allocSizes.end()) { - start += it->second; + start += i + it->second; } else { // We don't know how big it is, so just skip to the next one. - start += 1; + start += i + 1; } return false; }