mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
synced 2024-11-22 15:04:34 +00:00
Fixed some calculations in TLSF.
Code by @medranSolus
This commit is contained in:
parent
08759cbec5
commit
ff99bf7dea
@ -9896,7 +9896,7 @@ bool VmaBlockMetadata_TLSF::CreateAllocationRequest(
|
||||
sizeForNextList += (1ULL << (VMA_BITSCAN_MSB(allocSize) - SECOND_LEVEL_INDEX)) - 1;
|
||||
}
|
||||
else
|
||||
sizeForNextList += 1 << SECOND_LEVEL_INDEX;
|
||||
sizeForNextList += (1 << SECOND_LEVEL_INDEX) - 1;
|
||||
|
||||
uint32_t nextListIndex = 0;
|
||||
uint32_t prevListIndex = 0;
|
||||
@ -10246,7 +10246,12 @@ uint32_t VmaBlockMetadata_TLSF::GetListIndex(uint8_t memoryClass, uint16_t secon
|
||||
{
|
||||
if (memoryClass == 0)
|
||||
return secondIndex;
|
||||
return static_cast<uint32_t>(memoryClass - 1) * (1 << SECOND_LEVEL_INDEX) + secondIndex + 4;
|
||||
|
||||
const uint32_t index = static_cast<uint32_t>(memoryClass - 1) * (1 << SECOND_LEVEL_INDEX) + secondIndex;
|
||||
if (IsVirtual())
|
||||
return index + (1 << SECOND_LEVEL_INDEX);
|
||||
else
|
||||
return index + 4;
|
||||
}
|
||||
|
||||
uint32_t VmaBlockMetadata_TLSF::GetListIndex(VkDeviceSize size) const
|
||||
|
Loading…
Reference in New Issue
Block a user