mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-19 05:52:11 +01:00
[hud] Show compiler activity indicator for at least one second
Otherwise this would flicker when shaders are already cached.
This commit is contained in:
parent
35a2a02714
commit
044e3967e7
@ -3,7 +3,8 @@
|
||||
namespace dxvk::hud {
|
||||
|
||||
HudStats::HudStats(HudElements elements)
|
||||
: m_elements(filterElements(elements)) { }
|
||||
: m_elements(filterElements(elements)),
|
||||
m_compilerShowTime(std::chrono::high_resolution_clock::now()) { }
|
||||
|
||||
|
||||
HudStats::~HudStats() {
|
||||
@ -153,8 +154,19 @@ namespace dxvk::hud {
|
||||
const Rc<DxvkContext>& context,
|
||||
HudRenderer& renderer,
|
||||
HudPos position) {
|
||||
auto now = std::chrono::high_resolution_clock::now();
|
||||
bool doShow = m_prevCounters.getCtr(DxvkStatCounter::PipeCompilerBusy);
|
||||
|
||||
if (m_prevCounters.getCtr(DxvkStatCounter::PipeCompilerBusy)
|
||||
&& m_diffCounters.getCtr(DxvkStatCounter::PipeCompilerBusy))
|
||||
m_compilerShowTime = now;
|
||||
|
||||
if (m_prevCounters.getCtr(DxvkStatCounter::PipeCompilerBusy)) {
|
||||
if (!doShow) {
|
||||
doShow |= std::chrono::duration_cast<std::chrono::milliseconds>(now - m_compilerShowTime)
|
||||
< std::chrono::milliseconds(1000);
|
||||
}
|
||||
|
||||
if (doShow) {
|
||||
renderer.drawText(context, 16.0f,
|
||||
{ position.x, position.y },
|
||||
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
||||
|
@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <chrono>
|
||||
|
||||
#include "../dxvk_stats.h"
|
||||
|
||||
#include "dxvk_hud_config.h"
|
||||
@ -35,6 +37,8 @@ namespace dxvk::hud {
|
||||
|
||||
DxvkStatCounters m_prevCounters;
|
||||
DxvkStatCounters m_diffCounters;
|
||||
|
||||
std::chrono::high_resolution_clock::time_point m_compilerShowTime;
|
||||
|
||||
HudPos printDrawCallStats(
|
||||
const Rc<DxvkContext>& context,
|
||||
|
Loading…
x
Reference in New Issue
Block a user