diff options
author | Fernando S <fsahmkow27@gmail.com> | 2022-06-30 12:38:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-30 12:38:50 +0200 |
commit | 603952bc27aca2e17d39def7710d9af36791f15c (patch) | |
tree | 8b6b2f943bbf2fc749dbe144eee26cd144c084c9 /src/common/x64 | |
parent | Merge pull request #8518 from yuzu-emu/revert-8379-amd-push-desc-workaround (diff) | |
parent | Adress Feedback. (diff) | |
download | yuzu-603952bc27aca2e17d39def7710d9af36791f15c.tar yuzu-603952bc27aca2e17d39def7710d9af36791f15c.tar.gz yuzu-603952bc27aca2e17d39def7710d9af36791f15c.tar.bz2 yuzu-603952bc27aca2e17d39def7710d9af36791f15c.tar.lz yuzu-603952bc27aca2e17d39def7710d9af36791f15c.tar.xz yuzu-603952bc27aca2e17d39def7710d9af36791f15c.tar.zst yuzu-603952bc27aca2e17d39def7710d9af36791f15c.zip |
Diffstat (limited to 'src/common/x64')
-rw-r--r-- | src/common/x64/native_clock.cpp | 5 | ||||
-rw-r--r-- | src/common/x64/native_clock.h | 6 |
2 files changed, 3 insertions, 8 deletions
diff --git a/src/common/x64/native_clock.cpp b/src/common/x64/native_clock.cpp index 1b7194503..6aaa8cdf9 100644 --- a/src/common/x64/native_clock.cpp +++ b/src/common/x64/native_clock.cpp @@ -75,8 +75,8 @@ NativeClock::NativeClock(u64 emulated_cpu_frequency_, u64 emulated_clock_frequen } u64 NativeClock::GetRTSC() { - TimePoint new_time_point{}; TimePoint current_time_point{}; + TimePoint new_time_point{}; current_time_point.pack = Common::AtomicLoad128(time_point.pack.data()); do { @@ -89,8 +89,7 @@ u64 NativeClock::GetRTSC() { new_time_point.inner.accumulated_ticks = current_time_point.inner.accumulated_ticks + diff; } while (!Common::AtomicCompareAndSwap(time_point.pack.data(), new_time_point.pack, current_time_point.pack, current_time_point.pack)); - /// The clock cannot be more precise than the guest timer, remove the lower bits - return new_time_point.inner.accumulated_ticks & inaccuracy_mask; + return new_time_point.inner.accumulated_ticks; } void NativeClock::Pause(bool is_paused) { diff --git a/src/common/x64/native_clock.h b/src/common/x64/native_clock.h index 30d2ba2e9..38ae7a462 100644 --- a/src/common/x64/native_clock.h +++ b/src/common/x64/native_clock.h @@ -37,12 +37,8 @@ private: } inner; }; - /// value used to reduce the native clocks accuracy as some apss rely on - /// undefined behavior where the level of accuracy in the clock shouldn't - /// be higher. - static constexpr u64 inaccuracy_mask = ~(UINT64_C(0x400) - 1); - TimePoint time_point; + // factors u64 clock_rtsc_factor{}; u64 cpu_rtsc_factor{}; |