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

Function TestGpuData

src/Tests.cpp:8306–8338  ·  view source on GitHub ↗

Test the testing environment.

Source from the content-addressed store, hash-verified

8304
8305// Test the testing environment.
8306static void TestGpuData()
8307{
8308 RandomNumberGenerator rand = { 53434 };
8309
8310 std::vector<AllocInfo> allocInfo;
8311
8312 for(size_t i = 0; i < 100; ++i)
8313 {
8314 AllocInfo info = {};
8315
8316 info.m_BufferInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
8317 info.m_BufferInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT |
8318 VK_BUFFER_USAGE_TRANSFER_SRC_BIT |
8319 VK_BUFFER_USAGE_VERTEX_BUFFER_BIT;
8320 info.m_BufferInfo.size = 1024 * 1024 * (rand.Generate() % 9 + 1);
8321
8322 VmaAllocationCreateInfo allocCreateInfo = {};
8323 allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO;
8324
8325 VkResult res = vmaCreateBuffer(g_hAllocator, &info.m_BufferInfo, &allocCreateInfo, &info.m_Buffer, &info.m_Allocation, nullptr);
8326 TEST(res == VK_SUCCESS);
8327
8328 info.m_StartValue = rand.Generate();
8329
8330 allocInfo.push_back(std::move(info));
8331 }
8332
8333 UploadGpuData(allocInfo.data(), allocInfo.size());
8334
8335 ValidateGpuData(allocInfo.data(), allocInfo.size());
8336
8337 DestroyAllAllocations(allocInfo);
8338}
8339
8340static void TestVirtualBlocksAlgorithmsBenchmark()
8341{

Callers

nothing calls this directly

Calls 9

vmaCreateBufferFunction · 0.85
TESTEnum · 0.85
UploadGpuDataFunction · 0.85
ValidateGpuDataFunction · 0.85
DestroyAllAllocationsFunction · 0.85
GenerateMethod · 0.80
push_backMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected