From 08d5b4e0e7f1aef0909d62b2287d463d13cafba3 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Fri, 13 Dec 2019 13:14:23 +0100 Subject: [PATCH] [hud] Don't average the draw call count Turns out this was a bad idea. --- src/dxvk/hud/dxvk_hud_item.cpp | 16 +++++++--------- src/dxvk/hud/dxvk_hud_item.h | 1 - 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/dxvk/hud/dxvk_hud_item.cpp b/src/dxvk/hud/dxvk_hud_item.cpp index 02e9a70e9..d315f2772 100644 --- a/src/dxvk/hud/dxvk_hud_item.cpp +++ b/src/dxvk/hud/dxvk_hud_item.cpp @@ -338,20 +338,18 @@ namespace dxvk::hud { void HudDrawCallStatsItem::update(dxvk::high_resolution_clock::time_point time) { auto elapsed = std::chrono::duration_cast(time - m_lastUpdate); - m_frameCount += 1; + DxvkStatCounters counters = m_device->getStatCounters(); + auto diffCounters = counters.diff(m_prevCounters); if (elapsed.count() >= UpdateInterval) { - DxvkStatCounters counters = m_device->getStatCounters(); - auto diffCounters = counters.diff(m_prevCounters); + m_gpCount = diffCounters.getCtr(DxvkStatCounter::CmdDrawCalls); + m_cpCount = diffCounters.getCtr(DxvkStatCounter::CmdDispatchCalls); + m_rpCount = diffCounters.getCtr(DxvkStatCounter::CmdRenderPassCount); - m_gpCount = diffCounters.getCtr(DxvkStatCounter::CmdDrawCalls) / m_frameCount; - m_cpCount = diffCounters.getCtr(DxvkStatCounter::CmdDispatchCalls) / m_frameCount; - m_rpCount = diffCounters.getCtr(DxvkStatCounter::CmdRenderPassCount) / m_frameCount; - - m_prevCounters = counters; m_lastUpdate = time; - m_frameCount = 0; } + + m_prevCounters = counters; } diff --git a/src/dxvk/hud/dxvk_hud_item.h b/src/dxvk/hud/dxvk_hud_item.h index 44d308b5e..d8937bc63 100644 --- a/src/dxvk/hud/dxvk_hud_item.h +++ b/src/dxvk/hud/dxvk_hud_item.h @@ -269,7 +269,6 @@ namespace dxvk::hud { Rc m_device; DxvkStatCounters m_prevCounters; - uint64_t m_frameCount = 0; uint64_t m_gpCount = 0; uint64_t m_cpCount = 0;