diff options
Diffstat (limited to 'src/video_core/gpu.cpp')
| -rw-r--r-- | src/video_core/gpu.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index 70762c51a..db385076d 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp | |||
| @@ -193,18 +193,13 @@ struct GPU::Impl { | |||
| 193 | } | 193 | } |
| 194 | 194 | ||
| 195 | [[nodiscard]] u64 GetTicks() const { | 195 | [[nodiscard]] u64 GetTicks() const { |
| 196 | // This values were reversed engineered by fincs from NVN | 196 | u64 gpu_tick = system.CoreTiming().GetGPUTicks(); |
| 197 | // The GPU clock is 614.4 MHz | ||
| 198 | using NsToGPUTickRatio = std::ratio<614'400'000, std::nano::den>; | ||
| 199 | static_assert(NsToGPUTickRatio::num == 384 && NsToGPUTickRatio::den == 625); | ||
| 200 | |||
| 201 | u64 nanoseconds = system.CoreTiming().GetGlobalTimeNs().count(); | ||
| 202 | 197 | ||
| 203 | if (Settings::values.use_fast_gpu_time.GetValue()) { | 198 | if (Settings::values.use_fast_gpu_time.GetValue()) { |
| 204 | nanoseconds /= 256; | 199 | gpu_tick /= 256; |
| 205 | } | 200 | } |
| 206 | 201 | ||
| 207 | return nanoseconds * NsToGPUTickRatio::num / NsToGPUTickRatio::den; | 202 | return gpu_tick; |
| 208 | } | 203 | } |
| 209 | 204 | ||
| 210 | [[nodiscard]] bool IsAsync() const { | 205 | [[nodiscard]] bool IsAsync() const { |