mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[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:
parent
ac9610f377
commit
3b128179ab
@ -205,6 +205,8 @@ namespace dxvk {
|
|||||||
result = this->tryAlloc(req, dedAllocPtr, flags & ~optFlags, priority);
|
result = this->tryAlloc(req, dedAllocPtr, flags & ~optFlags, priority);
|
||||||
|
|
||||||
if (!result) {
|
if (!result) {
|
||||||
|
DxvkAdapterMemoryInfo memHeapInfo = m_device->adapter()->getMemoryHeapInfo();
|
||||||
|
|
||||||
Logger::err(str::format(
|
Logger::err(str::format(
|
||||||
"DxvkMemoryAllocator: Memory allocation failed",
|
"DxvkMemoryAllocator: Memory allocation failed",
|
||||||
"\n Size: ", req->size,
|
"\n Size: ", req->size,
|
||||||
@ -216,7 +218,13 @@ namespace dxvk {
|
|||||||
Logger::err(str::format("Heap ", i, ": ",
|
Logger::err(str::format("Heap ", i, ": ",
|
||||||
(m_memHeaps[i].stats.memoryAllocated >> 20), " MB allocated, ",
|
(m_memHeaps[i].stats.memoryAllocated >> 20), " MB allocated, ",
|
||||||
(m_memHeaps[i].stats.memoryUsed >> 20), " MB used, ",
|
(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");
|
throw DxvkError("DxvkMemoryAllocator: Memory allocation failed");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user