From 09284988ff0afbc58ab975592c5c3aed6aa999ac Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Thu, 3 Oct 2024 01:07:47 +0200 Subject: [PATCH] [hud] Show memory used percentage relative to budget --- src/dxvk/hud/dxvk_hud_item.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dxvk/hud/dxvk_hud_item.cpp b/src/dxvk/hud/dxvk_hud_item.cpp index 5fd33ba72..d17001c4e 100644 --- a/src/dxvk/hud/dxvk_hud_item.cpp +++ b/src/dxvk/hud/dxvk_hud_item.cpp @@ -591,7 +591,9 @@ namespace dxvk::hud { uint64_t memUsedMib = m_heaps[i].memoryUsed >> 20; uint64_t memAllocatedMib = m_heaps[i].memoryAllocated >> 20; - uint64_t percentage = (100 * m_heaps[i].memoryAllocated) / m_memory.memoryHeaps[i].size; + uint64_t percentage = m_heaps[i].memoryBudget + ? (100u * m_heaps[i].memoryAllocated) / m_heaps[i].memoryBudget + : 0u; std::string label = str::format(isDeviceLocal ? "Vidmem" : "Sysmem", " heap ", i, ": "); std::string text = str::format(std::setfill(' '), std::setw(5), memAllocatedMib, " MB (", percentage, "%) ",