mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
synced 2024-11-23 12:40:05 +00:00
Add budget information to JSON dump
Doesn't require detailedMap=VK_TRUE.
This commit is contained in:
parent
4f900cd1b3
commit
b85ff83bf3
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user