mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-18 05:17:57 -05:00
Common: improve native clock.
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
#include "common/wall_clock.h"
|
||||
|
||||
namespace Common {
|
||||
@ -28,13 +29,9 @@ public:
|
||||
private:
|
||||
u64 GetRTSC();
|
||||
|
||||
union alignas(16) TimePoint {
|
||||
TimePoint() : pack{} {}
|
||||
u128 pack{};
|
||||
struct Inner {
|
||||
u64 last_measure{};
|
||||
u64 accumulated_ticks{};
|
||||
} inner;
|
||||
struct alignas(16) TimePoint {
|
||||
u64 last_measure{};
|
||||
u64 accumulated_ticks{};
|
||||
};
|
||||
|
||||
/// value used to reduce the native clocks accuracy as some apss rely on
|
||||
@ -42,7 +39,7 @@ private:
|
||||
/// be higher.
|
||||
static constexpr u64 inaccuracy_mask = ~(UINT64_C(0x400) - 1);
|
||||
|
||||
TimePoint time_point;
|
||||
std::atomic<TimePoint> time_point;
|
||||
// factors
|
||||
u64 clock_rtsc_factor{};
|
||||
u64 cpu_rtsc_factor{};
|
||||
|
Reference in New Issue
Block a user