mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
synced 2024-11-05 12:20:07 +00:00
parent
3fd264ae1d
commit
d00699f26d
@ -3572,7 +3572,7 @@ static void TestLinearAllocator()
|
|||||||
constexpr size_t maxBufCount = 100;
|
constexpr size_t maxBufCount = 100;
|
||||||
std::vector<BufferInfo> bufInfo;
|
std::vector<BufferInfo> bufInfo;
|
||||||
|
|
||||||
constexpr VkDeviceSize bufSizeMin = 32;
|
constexpr VkDeviceSize bufSizeMin = 64;
|
||||||
constexpr VkDeviceSize bufSizeMax = 1024;
|
constexpr VkDeviceSize bufSizeMax = 1024;
|
||||||
VmaAllocationInfo allocInfo;
|
VmaAllocationInfo allocInfo;
|
||||||
VkDeviceSize prevOffset = 0;
|
VkDeviceSize prevOffset = 0;
|
||||||
@ -3584,7 +3584,7 @@ static void TestLinearAllocator()
|
|||||||
VkDeviceSize bufSumSize = 0;
|
VkDeviceSize bufSumSize = 0;
|
||||||
for(size_t i = 0; i < maxBufCount; ++i)
|
for(size_t i = 0; i < maxBufCount; ++i)
|
||||||
{
|
{
|
||||||
bufCreateInfo.size = align_up<VkDeviceSize>(bufSizeMin + rand.Generate() % (bufSizeMax - bufSizeMin), 32);
|
bufCreateInfo.size = align_up<VkDeviceSize>(bufSizeMin + rand.Generate() % (bufSizeMax - bufSizeMin), 64);
|
||||||
BufferInfo newBufInfo;
|
BufferInfo newBufInfo;
|
||||||
res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo,
|
res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo,
|
||||||
&newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo);
|
&newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo);
|
||||||
@ -3617,7 +3617,7 @@ static void TestLinearAllocator()
|
|||||||
// Allocate number of buffers of varying size that surely fit into this block.
|
// Allocate number of buffers of varying size that surely fit into this block.
|
||||||
for(size_t i = 0; i < maxBufCount; ++i)
|
for(size_t i = 0; i < maxBufCount; ++i)
|
||||||
{
|
{
|
||||||
bufCreateInfo.size = align_up<VkDeviceSize>(bufSizeMin + rand.Generate() % (bufSizeMax - bufSizeMin), 32);
|
bufCreateInfo.size = align_up<VkDeviceSize>(bufSizeMin + rand.Generate() % (bufSizeMax - bufSizeMin), 64);
|
||||||
BufferInfo newBufInfo;
|
BufferInfo newBufInfo;
|
||||||
res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo,
|
res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo,
|
||||||
&newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo);
|
&newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo);
|
||||||
@ -3638,7 +3638,7 @@ static void TestLinearAllocator()
|
|||||||
// Create some more
|
// Create some more
|
||||||
for(size_t i = 0; i < maxBufCount / 5; ++i)
|
for(size_t i = 0; i < maxBufCount / 5; ++i)
|
||||||
{
|
{
|
||||||
bufCreateInfo.size = align_up<VkDeviceSize>(bufSizeMin + rand.Generate() % (bufSizeMax - bufSizeMin), 32);
|
bufCreateInfo.size = align_up<VkDeviceSize>(bufSizeMin + rand.Generate() % (bufSizeMax - bufSizeMin), 64);
|
||||||
BufferInfo newBufInfo;
|
BufferInfo newBufInfo;
|
||||||
res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo,
|
res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo,
|
||||||
&newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo);
|
&newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo);
|
||||||
@ -3733,7 +3733,7 @@ static void TestLinearAllocator()
|
|||||||
allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT;
|
allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT;
|
||||||
else
|
else
|
||||||
allocCreateInfo.flags &= ~VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT;
|
allocCreateInfo.flags &= ~VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT;
|
||||||
bufCreateInfo.size = align_up<VkDeviceSize>(bufSizeMin + rand.Generate() % (bufSizeMax - bufSizeMin), 32);
|
bufCreateInfo.size = align_up<VkDeviceSize>(bufSizeMin + rand.Generate() % (bufSizeMax - bufSizeMin), 64);
|
||||||
BufferInfo newBufInfo;
|
BufferInfo newBufInfo;
|
||||||
res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo,
|
res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo,
|
||||||
&newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo);
|
&newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo);
|
||||||
@ -3768,7 +3768,7 @@ static void TestLinearAllocator()
|
|||||||
allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT;
|
allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT;
|
||||||
else
|
else
|
||||||
allocCreateInfo.flags &= ~VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT;
|
allocCreateInfo.flags &= ~VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT;
|
||||||
bufCreateInfo.size = align_up<VkDeviceSize>(bufSizeMin + rand.Generate() % (bufSizeMax - bufSizeMin), 32);
|
bufCreateInfo.size = align_up<VkDeviceSize>(bufSizeMin + rand.Generate() % (bufSizeMax - bufSizeMin), 64);
|
||||||
BufferInfo newBufInfo;
|
BufferInfo newBufInfo;
|
||||||
res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo,
|
res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo,
|
||||||
&newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo);
|
&newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo);
|
||||||
@ -3795,7 +3795,7 @@ static void TestLinearAllocator()
|
|||||||
allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT;
|
allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT;
|
||||||
else
|
else
|
||||||
allocCreateInfo.flags &= ~VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT;
|
allocCreateInfo.flags &= ~VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT;
|
||||||
bufCreateInfo.size = align_up<VkDeviceSize>(bufSizeMin + rand.Generate() % (bufSizeMax - bufSizeMin), 32);
|
bufCreateInfo.size = align_up<VkDeviceSize>(bufSizeMin + rand.Generate() % (bufSizeMax - bufSizeMin), 64);
|
||||||
BufferInfo newBufInfo;
|
BufferInfo newBufInfo;
|
||||||
res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo,
|
res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo,
|
||||||
&newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo);
|
&newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo);
|
||||||
|
Loading…
Reference in New Issue
Block a user