MCPcopy Create free account
hub / github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator / TestBasics

Function TestBasics

src/Tests.cpp:3194–3232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3192}
3193
3194static void TestBasics()
3195{
3196 wprintf(L"Test basics\n");
3197
3198 VkResult res;
3199
3200 TestGetAllocatorInfo();
3201
3202 TestMemoryRequirements();
3203
3204 // Allocation that is MAPPED and not necessarily HOST_VISIBLE.
3205 {
3206 VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
3207 bufCreateInfo.usage = VK_BUFFER_USAGE_INDEX_BUFFER_BIT;
3208 bufCreateInfo.size = 128;
3209
3210 VmaAllocationCreateInfo allocCreateInfo = {};
3211 allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE;
3212 allocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VMA_ALLOCATION_CREATE_MAPPED_BIT;
3213
3214 VkBuffer buf; VmaAllocation alloc; VmaAllocationInfo allocInfo;
3215 res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo);
3216 TEST(res == VK_SUCCESS);
3217
3218 vmaDestroyBuffer(g_hAllocator, buf, alloc);
3219
3220 // Same with DEDICATED_MEMORY.
3221 allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT;
3222
3223 res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo);
3224 TEST(res == VK_SUCCESS);
3225
3226 vmaDestroyBuffer(g_hAllocator, buf, alloc);
3227 }
3228
3229 TestUserData();
3230
3231 TestInvalidAllocations();
3232}
3233
3234static void TestVirtualBlocks()
3235{

Callers 1

TestFunction · 0.85

Calls 7

TestGetAllocatorInfoFunction · 0.85
TestMemoryRequirementsFunction · 0.85
vmaCreateBufferFunction · 0.85
TESTEnum · 0.85
vmaDestroyBufferFunction · 0.85
TestUserDataFunction · 0.85
TestInvalidAllocationsFunction · 0.85

Tested by

no test coverage detected