diff options
| author | 2020-04-20 13:20:52 -0400 | |
|---|---|---|
| committer | 2020-04-23 08:52:57 -0400 | |
| commit | b8aef40c56588c999b15a63516b5d68958f667df (patch) | |
| tree | 0edd0e6d5346b8cc3d992962c6381efe7a897dc2 /src/video_core/gpu.cpp | |
| parent | Maxwell3D: Process Macros on MultiMethod. (diff) | |
| download | yuzu-b8aef40c56588c999b15a63516b5d68958f667df.tar.gz yuzu-b8aef40c56588c999b15a63516b5d68958f667df.tar.xz yuzu-b8aef40c56588c999b15a63516b5d68958f667df.zip | |
GPU: Add Fast GPU Time Option.
Diffstat (limited to 'src/video_core/gpu.cpp')
| -rw-r--r-- | src/video_core/gpu.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index 54e7876a6..d2bd3cc9d 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include "core/core_timing_util.h" | 9 | #include "core/core_timing_util.h" |
| 10 | #include "core/frontend/emu_window.h" | 10 | #include "core/frontend/emu_window.h" |
| 11 | #include "core/memory.h" | 11 | #include "core/memory.h" |
| 12 | #include "core/settings.h" | ||
| 12 | #include "video_core/engines/fermi_2d.h" | 13 | #include "video_core/engines/fermi_2d.h" |
| 13 | #include "video_core/engines/kepler_compute.h" | 14 | #include "video_core/engines/kepler_compute.h" |
| 14 | #include "video_core/engines/kepler_memory.h" | 15 | #include "video_core/engines/kepler_memory.h" |
| @@ -154,7 +155,10 @@ u64 GPU::GetTicks() const { | |||
| 154 | constexpr u64 gpu_ticks_den = 625; | 155 | constexpr u64 gpu_ticks_den = 625; |
| 155 | 156 | ||
| 156 | const u64 cpu_ticks = system.CoreTiming().GetTicks(); | 157 | const u64 cpu_ticks = system.CoreTiming().GetTicks(); |
| 157 | const u64 nanoseconds = Core::Timing::CyclesToNs(cpu_ticks).count(); | 158 | u64 nanoseconds = Core::Timing::CyclesToNs(cpu_ticks).count(); |
| 159 | if (Settings::values.use_fast_gpu_time) { | ||
| 160 | nanoseconds /= 256; | ||
| 161 | } | ||
| 158 | const u64 nanoseconds_num = nanoseconds / gpu_ticks_den; | 162 | const u64 nanoseconds_num = nanoseconds / gpu_ticks_den; |
| 159 | const u64 nanoseconds_rem = nanoseconds % gpu_ticks_den; | 163 | const u64 nanoseconds_rem = nanoseconds % gpu_ticks_den; |
| 160 | return nanoseconds_num * gpu_ticks_num + (nanoseconds_rem * gpu_ticks_num) / gpu_ticks_den; | 164 | return nanoseconds_num * gpu_ticks_num + (nanoseconds_rem * gpu_ticks_num) / gpu_ticks_den; |