| 15312 | #if VMA_STATS_STRING_ENABLED |
| 15313 | |
| 15314 | VMA_CALL_PRE void VMA_CALL_POST vmaBuildStatsString( |
| 15315 | VmaAllocator allocator, |
| 15316 | char** ppStatsString, |
| 15317 | VkBool32 detailedMap) |
| 15318 | { |
| 15319 | VMA_ASSERT(allocator && ppStatsString); |
| 15320 | VMA_DEBUG_GLOBAL_MUTEX_LOCK |
| 15321 | |
| 15322 | VmaStringBuilder sb(allocator->GetAllocationCallbacks()); |
| 15323 | { |
| 15324 | VmaBudget budgets[VK_MAX_MEMORY_HEAPS]; |
| 15325 | allocator->GetHeapBudgets(budgets, 0, allocator->GetMemoryHeapCount()); |
| 15326 | |
| 15327 | VmaTotalStatistics stats; |
| 15328 | allocator->CalculateStatistics(&stats); |
| 15329 | |
| 15330 | VmaJsonWriter json(allocator->GetAllocationCallbacks(), sb); |
| 15331 | json.BeginObject(); |
| 15332 | { |
| 15333 | json.WriteString("General"); |
| 15334 | json.BeginObject(); |
| 15335 | { |
| 15336 | const VkPhysicalDeviceProperties& deviceProperties = allocator->m_PhysicalDeviceProperties; |
| 15337 | const VkPhysicalDeviceMemoryProperties& memoryProperties = allocator->m_MemProps; |
| 15338 | |
| 15339 | json.WriteString("API"); |
| 15340 | json.WriteString("Vulkan"); |
| 15341 | |
| 15342 | json.WriteString("apiVersion"); |
| 15343 | json.BeginString(); |
| 15344 | json.ContinueString(VK_VERSION_MAJOR(deviceProperties.apiVersion)); |
| 15345 | json.ContinueString("."); |
| 15346 | json.ContinueString(VK_VERSION_MINOR(deviceProperties.apiVersion)); |
| 15347 | json.ContinueString("."); |
| 15348 | json.ContinueString(VK_VERSION_PATCH(deviceProperties.apiVersion)); |
| 15349 | json.EndString(); |
| 15350 | |
| 15351 | json.WriteString("GPU"); |
| 15352 | json.WriteString(deviceProperties.deviceName); |
| 15353 | json.WriteString("deviceType"); |
| 15354 | json.WriteNumber(static_cast<uint32_t>(deviceProperties.deviceType)); |
| 15355 | |
| 15356 | json.WriteString("maxMemoryAllocationCount"); |
| 15357 | json.WriteNumber(deviceProperties.limits.maxMemoryAllocationCount); |
| 15358 | json.WriteString("bufferImageGranularity"); |
| 15359 | json.WriteNumber(deviceProperties.limits.bufferImageGranularity); |
| 15360 | json.WriteString("nonCoherentAtomSize"); |
| 15361 | json.WriteNumber(deviceProperties.limits.nonCoherentAtomSize); |
| 15362 | |
| 15363 | json.WriteString("memoryHeapCount"); |
| 15364 | json.WriteNumber(memoryProperties.memoryHeapCount); |
| 15365 | json.WriteString("memoryTypeCount"); |
| 15366 | json.WriteNumber(memoryProperties.memoryTypeCount); |
| 15367 | } |
| 15368 | json.EndObject(); |
| 15369 | } |
| 15370 | { |
| 15371 | json.WriteString("Total"); |
nothing calls this directly
no test coverage detected