Skip to content

Commit

Permalink
[hud] Display number of merged draws, if any
Browse files Browse the repository at this point in the history
  • Loading branch information
doitsujin committed Feb 21, 2025
1 parent 7bcc514 commit c0f9de2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
21 changes: 13 additions & 8 deletions src/dxvk/hud/dxvk_hud_item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -800,10 +800,11 @@ namespace dxvk::hud {
auto diffCounters = counters.diff(m_prevCounters);

if (elapsed.count() >= UpdateInterval) {
m_gpCount = diffCounters.getCtr(DxvkStatCounter::CmdDrawCalls);
m_cpCount = diffCounters.getCtr(DxvkStatCounter::CmdDispatchCalls);
m_rpCount = diffCounters.getCtr(DxvkStatCounter::CmdRenderPassCount);
m_pbCount = diffCounters.getCtr(DxvkStatCounter::CmdBarrierCount);
m_drawCallCount = diffCounters.getCtr(DxvkStatCounter::CmdDrawCalls);
m_drawCount = diffCounters.getCtr(DxvkStatCounter::CmdDrawsMerged) + m_drawCallCount;
m_dispatchCount = diffCounters.getCtr(DxvkStatCounter::CmdDispatchCalls);
m_renderPassCount = diffCounters.getCtr(DxvkStatCounter::CmdRenderPassCount);
m_barrierCount = diffCounters.getCtr(DxvkStatCounter::CmdBarrierCount);

m_lastUpdate = time;
}
Expand All @@ -818,21 +819,25 @@ namespace dxvk::hud {
const HudOptions& options,
HudRenderer& renderer,
HudPos position) {
std::string drawCount = m_drawCount > m_drawCallCount
? str::format(m_drawCallCount, " (", m_drawCount, ")")
: str::format(m_drawCallCount);

position.y += 16;
renderer.drawText(16, position, 0xffff8040, "Draw calls:");
renderer.drawText(16, { position.x + 192, position.y }, 0xffffffffu, str::format(m_gpCount));
renderer.drawText(16, { position.x + 192, position.y }, 0xffffffffu, drawCount);

position.y += 20;
renderer.drawText(16, position, 0xffff8040, "Dispatch calls:");
renderer.drawText(16, { position.x + 192, position.y }, 0xffffffffu, str::format(m_cpCount));
renderer.drawText(16, { position.x + 192, position.y }, 0xffffffffu, str::format(m_dispatchCount));

position.y += 20;
renderer.drawText(16, position, 0xffff8040, "Render passes:");
renderer.drawText(16, { position.x + 192, position.y }, 0xffffffffu, str::format(m_rpCount));
renderer.drawText(16, { position.x + 192, position.y }, 0xffffffffu, str::format(m_renderPassCount));

position.y += 20;
renderer.drawText(16, position, 0xffff8040, "Barriers:");
renderer.drawText(16, { position.x + 192, position.y }, 0xffffffffu, str::format(m_pbCount));
renderer.drawText(16, { position.x + 192, position.y }, 0xffffffffu, str::format(m_barrierCount));

position.y += 8;
return position;
Expand Down
11 changes: 6 additions & 5 deletions src/dxvk/hud/dxvk_hud_item.h
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,11 @@ namespace dxvk::hud {

DxvkStatCounters m_prevCounters;

uint64_t m_gpCount = 0;
uint64_t m_cpCount = 0;
uint64_t m_rpCount = 0;
uint64_t m_pbCount = 0;
uint64_t m_drawCallCount = 0;
uint64_t m_drawCount = 0;
uint64_t m_dispatchCount = 0;
uint64_t m_renderPassCount = 0;
uint64_t m_barrierCount = 0;

dxvk::high_resolution_clock::time_point m_lastUpdate
= dxvk::high_resolution_clock::now();
Expand Down Expand Up @@ -774,4 +775,4 @@ namespace dxvk::hud {

};

}
}

0 comments on commit c0f9de2

Please sign in to comment.