mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
synced 2024-11-05 12:20:07 +00:00
parent
6d2fe13627
commit
85a2580529
@ -8071,30 +8071,17 @@ void VmaBlockMetadata_Linear::AddStatistics(VmaStatistics& inoutStats) const
|
|||||||
{
|
{
|
||||||
const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
|
const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
|
||||||
|
|
||||||
// 1. Process free space before this allocation.
|
// Process this allocation.
|
||||||
if (lastOffset < suballoc.offset)
|
|
||||||
{
|
|
||||||
// There is free space from lastOffset to suballoc.offset.
|
|
||||||
const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2. Process this allocation.
|
|
||||||
// There is allocation with suballoc.offset, suballoc.size.
|
// There is allocation with suballoc.offset, suballoc.size.
|
||||||
++inoutStats.allocationCount;
|
++inoutStats.allocationCount;
|
||||||
|
|
||||||
// 3. Prepare for next iteration.
|
// Prepare for next iteration.
|
||||||
lastOffset = suballoc.offset + suballoc.size;
|
lastOffset = suballoc.offset + suballoc.size;
|
||||||
++nextAlloc2ndIndex;
|
++nextAlloc2ndIndex;
|
||||||
}
|
}
|
||||||
// We are at the end.
|
// We are at the end.
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (lastOffset < freeSpace2ndTo1stEnd)
|
|
||||||
{
|
|
||||||
// There is free space from lastOffset to freeSpace2ndTo1stEnd.
|
|
||||||
const VkDeviceSize unusedRangeSize = freeSpace2ndTo1stEnd - lastOffset;
|
|
||||||
}
|
|
||||||
|
|
||||||
// End of loop.
|
// End of loop.
|
||||||
lastOffset = freeSpace2ndTo1stEnd;
|
lastOffset = freeSpace2ndTo1stEnd;
|
||||||
}
|
}
|
||||||
@ -8118,30 +8105,17 @@ void VmaBlockMetadata_Linear::AddStatistics(VmaStatistics& inoutStats) const
|
|||||||
{
|
{
|
||||||
const VmaSuballocation& suballoc = suballocations1st[nextAlloc1stIndex];
|
const VmaSuballocation& suballoc = suballocations1st[nextAlloc1stIndex];
|
||||||
|
|
||||||
// 1. Process free space before this allocation.
|
// Process this allocation.
|
||||||
if (lastOffset < suballoc.offset)
|
|
||||||
{
|
|
||||||
// There is free space from lastOffset to suballoc.offset.
|
|
||||||
const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2. Process this allocation.
|
|
||||||
// There is allocation with suballoc.offset, suballoc.size.
|
// There is allocation with suballoc.offset, suballoc.size.
|
||||||
++inoutStats.allocationCount;
|
++inoutStats.allocationCount;
|
||||||
|
|
||||||
// 3. Prepare for next iteration.
|
// Prepare for next iteration.
|
||||||
lastOffset = suballoc.offset + suballoc.size;
|
lastOffset = suballoc.offset + suballoc.size;
|
||||||
++nextAlloc1stIndex;
|
++nextAlloc1stIndex;
|
||||||
}
|
}
|
||||||
// We are at the end.
|
// We are at the end.
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (lastOffset < freeSpace1stTo2ndEnd)
|
|
||||||
{
|
|
||||||
// There is free space from lastOffset to freeSpace1stTo2ndEnd.
|
|
||||||
const VkDeviceSize unusedRangeSize = freeSpace1stTo2ndEnd - lastOffset;
|
|
||||||
}
|
|
||||||
|
|
||||||
// End of loop.
|
// End of loop.
|
||||||
lastOffset = freeSpace1stTo2ndEnd;
|
lastOffset = freeSpace1stTo2ndEnd;
|
||||||
}
|
}
|
||||||
@ -8164,30 +8138,17 @@ void VmaBlockMetadata_Linear::AddStatistics(VmaStatistics& inoutStats) const
|
|||||||
{
|
{
|
||||||
const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
|
const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
|
||||||
|
|
||||||
// 1. Process free space before this allocation.
|
// Process this allocation.
|
||||||
if (lastOffset < suballoc.offset)
|
|
||||||
{
|
|
||||||
// There is free space from lastOffset to suballoc.offset.
|
|
||||||
const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2. Process this allocation.
|
|
||||||
// There is allocation with suballoc.offset, suballoc.size.
|
// There is allocation with suballoc.offset, suballoc.size.
|
||||||
++inoutStats.allocationCount;
|
++inoutStats.allocationCount;
|
||||||
|
|
||||||
// 3. Prepare for next iteration.
|
// Prepare for next iteration.
|
||||||
lastOffset = suballoc.offset + suballoc.size;
|
lastOffset = suballoc.offset + suballoc.size;
|
||||||
--nextAlloc2ndIndex;
|
--nextAlloc2ndIndex;
|
||||||
}
|
}
|
||||||
// We are at the end.
|
// We are at the end.
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (lastOffset < size)
|
|
||||||
{
|
|
||||||
// There is free space from lastOffset to size.
|
|
||||||
const VkDeviceSize unusedRangeSize = size - lastOffset;
|
|
||||||
}
|
|
||||||
|
|
||||||
// End of loop.
|
// End of loop.
|
||||||
lastOffset = size;
|
lastOffset = size;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user