yuzu-emu
/
yuzu
Archived
1
0
Fork 0

wall_clock: Increase precision requirements

We are providing a conversion to nanoseconds in NativeClock, which is more precise than the GPU tick.
This commit is contained in:
Morph 2023-07-27 18:40:56 -04:00
parent a1c355051e
commit bb4e676155
1 changed files with 2 additions and 2 deletions

View File

@ -56,12 +56,12 @@ std::unique_ptr<WallClock> CreateOptimalClock() {
#ifdef ARCHITECTURE_x86_64 #ifdef ARCHITECTURE_x86_64
const auto& caps = GetCPUCaps(); const auto& caps = GetCPUCaps();
if (caps.invariant_tsc && caps.tsc_frequency >= WallClock::GPUTickFreq) { if (caps.invariant_tsc && caps.tsc_frequency >= std::nano::den) {
return std::make_unique<X64::NativeClock>(caps.tsc_frequency); return std::make_unique<X64::NativeClock>(caps.tsc_frequency);
} else { } else {
// Fallback to StandardWallClock if the hardware TSC // Fallback to StandardWallClock if the hardware TSC
// - Is not invariant // - Is not invariant
// - Is not more precise than GPUTickFreq // - Is not more precise than 1 GHz (1ns resolution)
return std::make_unique<StandardWallClock>(); return std::make_unique<StandardWallClock>();
} }
#else #else