From 3b128179ab40c9c225e6c6f9bd514f466368816f Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Wed, 3 Jul 2019 11:11:12 +0200 Subject: [PATCH] [dxvk] Print VK_EXT_memory_budget stats on allocation failure Based on PR #1112, but using a cleaner method to check support for the VK_EXT_memory_budget extension. Suggested-by: Liam Middlebrook --- src/dxvk/dxvk_memory.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/dxvk/dxvk_memory.cpp b/src/dxvk/dxvk_memory.cpp index 3a095c56d..89b18da26 100644 --- a/src/dxvk/dxvk_memory.cpp +++ b/src/dxvk/dxvk_memory.cpp @@ -205,6 +205,8 @@ namespace dxvk { result = this->tryAlloc(req, dedAllocPtr, flags & ~optFlags, priority); if (!result) { + DxvkAdapterMemoryInfo memHeapInfo = m_device->adapter()->getMemoryHeapInfo(); + Logger::err(str::format( "DxvkMemoryAllocator: Memory allocation failed", "\n Size: ", req->size, @@ -216,7 +218,13 @@ namespace dxvk { Logger::err(str::format("Heap ", i, ": ", (m_memHeaps[i].stats.memoryAllocated >> 20), " MB allocated, ", (m_memHeaps[i].stats.memoryUsed >> 20), " MB used, ", - (m_memHeaps[i].properties.size >> 20), " MB available")); + m_device->extensions().extMemoryBudget + ? str::format( + (memHeapInfo.heaps[i].memoryAllocated >> 20), " MB allocated (driver), ", + (memHeapInfo.heaps[i].memoryAvailable >> 20), " MB available (driver), ", + (m_memHeaps[i].properties.size >> 20), " MB total") + : str::format( + (m_memHeaps[i].properties.size >> 20), " MB total"))); } throw DxvkError("DxvkMemoryAllocator: Memory allocation failed");