Skip to content

Commit

Permalink
Revert "Fix memory-scan bug in VulkanDeviceAllocator that probably ca…
Browse files Browse the repository at this point in the history
…uses some fragmentation."

This reverts commit ac6b491.
  • Loading branch information
hrydgard authored and orbea committed Dec 10, 2017
1 parent 31b4014 commit b590a48
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Common/Vulkan/VulkanMemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b590a48

Please sign in to comment.