diff --git a/src/util/util_fps_limiter.cpp b/src/util/util_fps_limiter.cpp index 61677b01..7bc9ed17 100644 --- a/src/util/util_fps_limiter.cpp +++ b/src/util/util_fps_limiter.cpp @@ -137,6 +137,14 @@ namespace dxvk { void FpsLimiter::initialize() { + updateSleepGranularity(); + m_sleepThreshold = 4 * m_sleepGranularity; + m_lastFrame = dxvk::high_resolution_clock::now(); + m_initialized = true; + } + + + void FpsLimiter::updateSleepGranularity() { HMODULE ntdll = ::GetModuleHandleW(L"ntdll.dll"); if (ntdll) { @@ -163,10 +171,6 @@ namespace dxvk { // Assume 1ms sleep granularity by default m_sleepGranularity = TimerDuration(10000); } - - m_sleepThreshold = 4 * m_sleepGranularity; - m_lastFrame = dxvk::high_resolution_clock::now(); - m_initialized = true; } } diff --git a/src/util/util_fps_limiter.h b/src/util/util_fps_limiter.h index ac3d92c8..b5ad21be 100644 --- a/src/util/util_fps_limiter.h +++ b/src/util/util_fps_limiter.h @@ -84,6 +84,8 @@ namespace dxvk { void initialize(); + void updateSleepGranularity(); + }; }