[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 <lmiddlebrook@nvidia.com>
This commit is contained in:
Philip Rebohle 2019-07-03 11:11:12 +02:00
parent ac9610f377
commit 3b128179ab
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
1 changed files with 9 additions and 1 deletions

View File

@ -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");