Skip to content

Commit b85ff83

Browse files
Add budget information to JSON dump
Doesn't require detailedMap=VK_TRUE.
1 parent 4f900cd commit b85ff83

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

src/vk_mem_alloc.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16262,6 +16262,9 @@ VMA_CALL_PRE void VMA_CALL_POST vmaBuildStatsString(
1626216262
VmaJsonWriter json(allocator->GetAllocationCallbacks(), sb);
1626316263
json.BeginObject();
1626416264

16265+
VmaBudget budget[VK_MAX_MEMORY_HEAPS];
16266+
allocator->GetBudget(budget, 0, allocator->GetMemoryHeapCount());
16267+
1626516268
VmaStats stats;
1626616269
allocator->CalculateStats(&stats);
1626716270

@@ -16286,6 +16289,20 @@ VMA_CALL_PRE void VMA_CALL_POST vmaBuildStatsString(
1628616289
}
1628716290
json.EndArray();
1628816291

16292+
json.WriteString("Budget");
16293+
json.BeginObject();
16294+
{
16295+
json.WriteString("BlockBytes");
16296+
json.WriteNumber(budget[heapIndex].blockBytes);
16297+
json.WriteString("AllocationBytes");
16298+
json.WriteNumber(budget[heapIndex].allocationBytes);
16299+
json.WriteString("Usage");
16300+
json.WriteNumber(budget[heapIndex].usage);
16301+
json.WriteString("Budget");
16302+
json.WriteNumber(budget[heapIndex].budget);
16303+
}
16304+
json.EndObject();
16305+
1628916306
if(stats.memoryHeap[heapIndex].blockCount > 0)
1629016307
{
1629116308
json.WriteString("Stats");

0 commit comments

Comments
 (0)