mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-31 14: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 {
|
namespace dxvk::hud {
|
||||||
|
|
||||||
HudStats::HudStats(HudElements elements)
|
HudStats::HudStats(HudElements elements)
|
||||||
: m_elements(filterElements(elements)) { }
|
: m_elements(filterElements(elements)),
|
||||||
|
m_compilerShowTime(std::chrono::high_resolution_clock::now()) { }
|
||||||
|
|
||||||
|
|
||||||
HudStats::~HudStats() {
|
HudStats::~HudStats() {
|
||||||
@ -153,8 +154,19 @@ namespace dxvk::hud {
|
|||||||
const Rc<DxvkContext>& context,
|
const Rc<DxvkContext>& context,
|
||||||
HudRenderer& renderer,
|
HudRenderer& renderer,
|
||||||
HudPos position) {
|
HudPos position) {
|
||||||
|
auto now = std::chrono::high_resolution_clock::now();
|
||||||
|
bool doShow = m_prevCounters.getCtr(DxvkStatCounter::PipeCompilerBusy);
|
||||||
|
|
||||||
if (m_prevCounters.getCtr(DxvkStatCounter::PipeCompilerBusy)) {
|
if (m_prevCounters.getCtr(DxvkStatCounter::PipeCompilerBusy)
|
||||||
|
&& m_diffCounters.getCtr(DxvkStatCounter::PipeCompilerBusy))
|
||||||
|
m_compilerShowTime = now;
|
||||||
|
|
||||||
|
if (!doShow) {
|
||||||
|
doShow |= std::chrono::duration_cast<std::chrono::milliseconds>(now - m_compilerShowTime)
|
||||||
|
< std::chrono::milliseconds(1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (doShow) {
|
||||||
renderer.drawText(context, 16.0f,
|
renderer.drawText(context, 16.0f,
|
||||||
{ position.x, position.y },
|
{ position.x, position.y },
|
||||||
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
{ 1.0f, 1.0f, 1.0f, 1.0f },
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
|
||||||
#include "../dxvk_stats.h"
|
#include "../dxvk_stats.h"
|
||||||
|
|
||||||
#include "dxvk_hud_config.h"
|
#include "dxvk_hud_config.h"
|
||||||
@ -36,6 +38,8 @@ namespace dxvk::hud {
|
|||||||
DxvkStatCounters m_prevCounters;
|
DxvkStatCounters m_prevCounters;
|
||||||
DxvkStatCounters m_diffCounters;
|
DxvkStatCounters m_diffCounters;
|
||||||
|
|
||||||
|
std::chrono::high_resolution_clock::time_point m_compilerShowTime;
|
||||||
|
|
||||||
HudPos printDrawCallStats(
|
HudPos printDrawCallStats(
|
||||||
const Rc<DxvkContext>& context,
|
const Rc<DxvkContext>& context,
|
||||||
HudRenderer& renderer,
|
HudRenderer& renderer,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user