VmaBlockMetadata_Buddy: Introduced m_LevelCount to limit number of levels in use by particular memory block, considering new constant MIN_NODE_SIZE.

This commit is contained in:
Adam Sawicki 2018-09-21 14:22:35 +02:00
parent d6e6d6bdf2
commit a01d4587df
2 changed files with 33 additions and 6 deletions

View file

@ -4160,6 +4160,13 @@ static void BasicTestBuddyAllocator()
&newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo);
assert(res == VK_SUCCESS);
bufInfo.push_back(newBufInfo);
// Test very small allocation, smaller than minimum node size.
bufCreateInfo.size = 1;
res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo,
&newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo);
assert(res == VK_SUCCESS);
bufInfo.push_back(newBufInfo);
VmaPoolStats stats = {};
vmaGetPoolStats(g_hAllocator, pool, &stats);