From c39c3e8dcc26a8095ea239bd0b9a1428246be692 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Tue, 26 Nov 2019 00:46:24 +0000 Subject: [PATCH] [dxvk] Hook up platform-specific clock See 89dfa2bc22577c758cb8badd34e4f177192a6eff --- src/dxvk/dxvk_compute.cpp | 8 ++++---- src/dxvk/dxvk_graphics.cpp | 8 ++++---- src/dxvk/dxvk_pipecache.h | 2 +- src/dxvk/dxvk_queue.cpp | 4 ++-- src/dxvk/hud/dxvk_hud_fps.h | 4 ++-- src/dxvk/hud/dxvk_hud_stats.cpp | 6 +++--- src/dxvk/hud/dxvk_hud_stats.h | 6 +++--- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/dxvk/dxvk_compute.cpp b/src/dxvk/dxvk_compute.cpp index ad62b6d9..cd7426ab 100644 --- a/src/dxvk/dxvk_compute.cpp +++ b/src/dxvk/dxvk_compute.cpp @@ -1,4 +1,4 @@ -#include +#include "../util/util_time.h" #include #include "dxvk_compute.h" @@ -117,10 +117,10 @@ namespace dxvk { info.basePipelineIndex = -1; // Time pipeline compilation for debugging purposes - std::chrono::high_resolution_clock::time_point t0, t1; + dxvk::high_resolution_clock::time_point t0, t1; if (Logger::logLevel() <= LogLevel::Debug) - t0 = std::chrono::high_resolution_clock::now(); + t0 = dxvk::high_resolution_clock::now(); VkPipeline pipeline = VK_NULL_HANDLE; if (m_vkd->vkCreateComputePipelines(m_vkd->device(), @@ -131,7 +131,7 @@ namespace dxvk { } if (Logger::logLevel() <= LogLevel::Debug) { - t1 = std::chrono::high_resolution_clock::now(); + t1 = dxvk::high_resolution_clock::now(); auto td = std::chrono::duration_cast(t1 - t0); Logger::debug(str::format("DxvkComputePipeline: Finished in ", td.count(), " ms")); } diff --git a/src/dxvk/dxvk_graphics.cpp b/src/dxvk/dxvk_graphics.cpp index 0f22bd2f..192e340b 100644 --- a/src/dxvk/dxvk_graphics.cpp +++ b/src/dxvk/dxvk_graphics.cpp @@ -1,4 +1,4 @@ -#include +#include "../util/util_time.h" #include "dxvk_device.h" #include "dxvk_graphics.h" @@ -396,10 +396,10 @@ namespace dxvk { info.pTessellationState = nullptr; // Time pipeline compilation for debugging purposes - std::chrono::high_resolution_clock::time_point t0, t1; + dxvk::high_resolution_clock::time_point t0, t1; if (Logger::logLevel() <= LogLevel::Debug) - t0 = std::chrono::high_resolution_clock::now(); + t0 = dxvk::high_resolution_clock::now(); VkPipeline pipeline = VK_NULL_HANDLE; if (m_vkd->vkCreateGraphicsPipelines(m_vkd->device(), @@ -410,7 +410,7 @@ namespace dxvk { } if (Logger::logLevel() <= LogLevel::Debug) { - t1 = std::chrono::high_resolution_clock::now(); + t1 = dxvk::high_resolution_clock::now(); auto td = std::chrono::duration_cast(t1 - t0); Logger::debug(str::format("DxvkGraphicsPipeline: Finished in ", td.count(), " ms")); } diff --git a/src/dxvk/dxvk_pipecache.h b/src/dxvk/dxvk_pipecache.h index d1cc7fba..1898bc1c 100644 --- a/src/dxvk/dxvk_pipecache.h +++ b/src/dxvk/dxvk_pipecache.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include "../util/util_time.h" #include #include diff --git a/src/dxvk/dxvk_queue.cpp b/src/dxvk/dxvk_queue.cpp index 01dc7057..b9214afa 100644 --- a/src/dxvk/dxvk_queue.cpp +++ b/src/dxvk/dxvk_queue.cpp @@ -145,13 +145,13 @@ namespace dxvk { while (!m_stopped.load()) { if (m_finishQueue.empty()) { - auto t0 = std::chrono::high_resolution_clock::now(); + auto t0 = dxvk::high_resolution_clock::now(); m_submitCond.wait(lock, [this] { return m_stopped.load() || !m_finishQueue.empty(); }); - auto t1 = std::chrono::high_resolution_clock::now(); + auto t1 = dxvk::high_resolution_clock::now(); m_gpuIdle += std::chrono::duration_cast(t1 - t0).count(); } diff --git a/src/dxvk/hud/dxvk_hud_fps.h b/src/dxvk/hud/dxvk_hud_fps.h index c8c4b984..a7d16c27 100644 --- a/src/dxvk/hud/dxvk_hud_fps.h +++ b/src/dxvk/hud/dxvk_hud_fps.h @@ -1,6 +1,6 @@ #pragma once -#include +#include "../util/util_time.h" #include "dxvk_hud_config.h" #include "dxvk_hud_renderer.h" @@ -13,7 +13,7 @@ namespace dxvk::hud { * Displays the current frames per second. */ class HudFps { - using Clock = std::chrono::high_resolution_clock; + using Clock = dxvk::high_resolution_clock; using TimeDiff = std::chrono::microseconds; using TimePoint = typename Clock::time_point; diff --git a/src/dxvk/hud/dxvk_hud_stats.cpp b/src/dxvk/hud/dxvk_hud_stats.cpp index 995f186b..ff4d17ea 100644 --- a/src/dxvk/hud/dxvk_hud_stats.cpp +++ b/src/dxvk/hud/dxvk_hud_stats.cpp @@ -4,7 +4,7 @@ namespace dxvk::hud { HudStats::HudStats(HudElements elements) : m_elements(filterElements(elements)), - m_compilerShowTime(std::chrono::high_resolution_clock::now()) { } + m_compilerShowTime(dxvk::high_resolution_clock::now()) { } HudStats::~HudStats() { @@ -58,7 +58,7 @@ namespace dxvk::hud { void HudStats::updateGpuLoad() { - auto now = std::chrono::high_resolution_clock::now(); + auto now = dxvk::high_resolution_clock::now(); uint64_t ticks = std::chrono::duration_cast(now - m_gpuLoadUpdateTime).count(); if (ticks >= 500'000) { @@ -194,7 +194,7 @@ namespace dxvk::hud { const Rc& context, HudRenderer& renderer, HudPos position) { - auto now = std::chrono::high_resolution_clock::now(); + auto now = dxvk::high_resolution_clock::now(); bool doShow = m_prevCounters.getCtr(DxvkStatCounter::PipeCompilerBusy); if (m_prevCounters.getCtr(DxvkStatCounter::PipeCompilerBusy) diff --git a/src/dxvk/hud/dxvk_hud_stats.h b/src/dxvk/hud/dxvk_hud_stats.h index 227f600c..6df1b32e 100644 --- a/src/dxvk/hud/dxvk_hud_stats.h +++ b/src/dxvk/hud/dxvk_hud_stats.h @@ -1,6 +1,6 @@ #pragma once -#include +#include "../util/util_time.h" #include "../dxvk_stats.h" @@ -38,8 +38,8 @@ namespace dxvk::hud { DxvkStatCounters m_prevCounters; DxvkStatCounters m_diffCounters; - std::chrono::high_resolution_clock::time_point m_gpuLoadUpdateTime; - std::chrono::high_resolution_clock::time_point m_compilerShowTime; + dxvk::high_resolution_clock::time_point m_gpuLoadUpdateTime; + dxvk::high_resolution_clock::time_point m_compilerShowTime; uint64_t m_prevGpuIdleTicks = 0; uint64_t m_diffGpuIdleTicks = 0;