Frame graph + Precise 60 fps timing (#998)

* video info: add frame graph

Toggle advanced info with CTRL+F10.
Also fixed imgui using gamepad for nav in wrong situations

* 60fps!

Implemented a timer that accumulates the time spent sleeping and sleeps for the remaining time.
Also measure entire PresentThread time instead of just the time spent in Flip.

* sceKernelGettimeofday: replace chrono by win32 api. Better performance

bb uses this function too much. Consuming almost 30% of cpu time
This commit is contained in:
Vinicius Rangel 2024-09-23 12:43:51 -03:00 committed by GitHub
parent a016792371
commit 5a8e8f5936
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 183 additions and 26 deletions

View file

@ -147,13 +147,20 @@ int PS4_SYSV_ABI sceKernelGettimeofday(OrbisKernelTimeval* tp) {
}
#ifdef _WIN64
auto now = std::chrono::system_clock::now();
auto duration = now.time_since_epoch();
auto seconds = std::chrono::duration_cast<std::chrono::seconds>(duration);
auto microsecs = std::chrono::duration_cast<std::chrono::microseconds>(duration - seconds);
FILETIME filetime;
GetSystemTimeAsFileTime(&filetime);
tp->tv_sec = seconds.count();
tp->tv_usec = microsecs.count();
constexpr u64 UNIX_TIME_START = 0x295E9648864000;
constexpr u64 TICKS_PER_SECOND = 1000000;
u64 ticks = filetime.dwHighDateTime;
ticks <<= 32;
ticks |= filetime.dwLowDateTime;
ticks /= 10;
ticks -= UNIX_TIME_START;
tp->tv_sec = ticks / TICKS_PER_SECOND;
tp->tv_usec = ticks % TICKS_PER_SECOND;
#else
timeval tv;
gettimeofday(&tv, nullptr);