summaryrefslogtreecommitdiff
path: root/src/video_core/gpu.cpp
diff options
context:
space:
mode:
authorGravatar Morph2023-03-01 21:06:19 -0500
committerGravatar Morph2023-03-05 02:36:31 -0500
commitbff14532825e7517882ca913738347059f73cf7f (patch)
treef21f509d4c7458a79e2fc399c1de3036a7efd51d /src/video_core/gpu.cpp
parentmain: (Windows) Set the current timer resolution to the maximum (diff)
downloadyuzu-bff14532825e7517882ca913738347059f73cf7f.tar.gz
yuzu-bff14532825e7517882ca913738347059f73cf7f.tar.xz
yuzu-bff14532825e7517882ca913738347059f73cf7f.zip
core_timing: Use higher precision sleeps on Windows
The precision of sleep_for and wait_for is limited to 1-1.5ms on Windows. Using SleepForOneTick() allows us to sleep for exactly one interval of the current timer resolution. This allows us to take advantage of systems that have a timer resolution of 0.5ms to reduce CPU overhead in the event loop.
Diffstat (limited to 'src/video_core/gpu.cpp')
-rw-r--r--src/video_core/gpu.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index 7024a19cf..2e7f9c5ed 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -197,7 +197,7 @@ struct GPU::Impl {
197 constexpr u64 gpu_ticks_num = 384; 197 constexpr u64 gpu_ticks_num = 384;
198 constexpr u64 gpu_ticks_den = 625; 198 constexpr u64 gpu_ticks_den = 625;
199 199
200 u64 nanoseconds = system.CoreTiming().GetGlobalTimeNs().count(); 200 u64 nanoseconds = system.CoreTiming().GetCPUTimeNs().count();
201 if (Settings::values.use_fast_gpu_time.GetValue()) { 201 if (Settings::values.use_fast_gpu_time.GetValue()) {
202 nanoseconds /= 256; 202 nanoseconds /= 256;
203 } 203 }