Implemented vmaBuildVirtualBlockStatsString, vmaFreeVirtualBlockStatsString

This commit is contained in:
Adam Sawicki 2021-10-28 17:00:17 +02:00
parent dfa2051cd2
commit c6432507c5
2 changed files with 121 additions and 64 deletions

View file

@ -2756,18 +2756,16 @@ static void TestVirtualBlocks()
TEST(statInfo.usedBytes == blockSize);
TEST(statInfo.unusedBytes + statInfo.usedBytes == blockSize);
#if 0
// # Generate JSON dump
WCHAR* json = nullptr;
block->BuildStatsString(&json);
char* json = nullptr;
vmaBuildVirtualBlockStatsString(block, &json, VK_TRUE);
{
std::wstring str(json);
CHECK_BOOL( str.find(L"\"UserData\": 1") != std::wstring::npos );
CHECK_BOOL( str.find(L"\"UserData\": 2") != std::wstring::npos );
std::string str(json);
TEST( str.find("\"UserData\": \"0000000000000001\"") != std::string::npos );
TEST( str.find("\"UserData\": \"0000000000000002\"") != std::string::npos );
}
block->FreeStatsString(json);
#endif
vmaFreeVirtualBlockStatsString(block, json);
// # Free alloc0, leave alloc2 unfreed.