Fixed reporting UserData in JSON dump for dedicated allocations.

This commit is contained in:
Adam Sawicki 2017-11-20 14:09:49 +01:00
parent 6a1f1e2d8d
commit 5bc033f19d

View File

@ -7570,11 +7570,27 @@ void VmaAllocator_T::PrintDetailedMap(VmaJsonWriter& json)
const VmaAllocation hAlloc = (*pDedicatedAllocVector)[i];
json.BeginObject(true);
json.WriteString("Type");
json.WriteString(VMA_SUBALLOCATION_TYPE_NAMES[hAlloc->GetSuballocationType()]);
json.WriteString("Size");
json.WriteNumber(hAlloc->GetSize());
json.WriteString("Type");
json.WriteString(VMA_SUBALLOCATION_TYPE_NAMES[hAlloc->GetSuballocationType()]);
const void* pUserData = hAlloc->GetUserData();
if(pUserData != VMA_NULL)
{
json.WriteString("UserData");
if(hAlloc->IsUserDataString())
{
json.WriteString((const char*)pUserData);
}
else
{
json.BeginString();
json.ContinueString_Pointer(pUserData);
json.EndString();
}
}
json.EndObject();
}