Add budget information to JSON dump

Doesn't require detailedMap=VK_TRUE.
This commit is contained in:
Adam Sawicki 2019-11-15 17:47:16 +01:00
parent 4f900cd1b3
commit b85ff83bf3

View File

@ -16262,6 +16262,9 @@ VMA_CALL_PRE void VMA_CALL_POST vmaBuildStatsString(
VmaJsonWriter json(allocator->GetAllocationCallbacks(), sb);
json.BeginObject();
VmaBudget budget[VK_MAX_MEMORY_HEAPS];
allocator->GetBudget(budget, 0, allocator->GetMemoryHeapCount());
VmaStats stats;
allocator->CalculateStats(&stats);
@ -16286,6 +16289,20 @@ VMA_CALL_PRE void VMA_CALL_POST vmaBuildStatsString(
}
json.EndArray();
json.WriteString("Budget");
json.BeginObject();
{
json.WriteString("BlockBytes");
json.WriteNumber(budget[heapIndex].blockBytes);
json.WriteString("AllocationBytes");
json.WriteNumber(budget[heapIndex].allocationBytes);
json.WriteString("Usage");
json.WriteNumber(budget[heapIndex].usage);
json.WriteString("Budget");
json.WriteNumber(budget[heapIndex].budget);
}
json.EndObject();
if(stats.memoryHeap[heapIndex].blockCount > 0)
{
json.WriteString("Stats");