mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-01 18:23:43 +01:00
Merge pull request #9492 from unknownbrackets/frame-drops
Allow debug logging of frame drops
This commit is contained in:
commit
33db883024
8 files changed
+49
-18
No files matched your search
+18
-2
@@ -477,6 +477,19 @@ static bool FrameTimingThrottled() {
|
||||
return !PSP_CoreParameter().unthrottle;
|
||||
}
|
||||
|
||||
static void DoFrameDropLogging(float scaledTimestep) {
|
||||
if (lastFrameTime != 0.0 && !wasPaused && lastFrameTime + scaledTimestep < curFrameTime) {
|
||||
const double actualTimestep = curFrameTime - lastFrameTime;
|
||||
|
||||
char stats[4096];
|
||||
__DisplayGetDebugStats(stats, sizeof(stats));
|
||||
NOTICE_LOG(HLE, "Dropping frames - budget = %.2fms / %.1ffps, actual = %.2fms (+%.2fms) / %.1ffps\n%s", scaledTimestep * 1000.0, 1.0 / scaledTimestep, actualTimestep * 1000.0, (actualTimestep - scaledTimestep) * 1000.0, 1.0 / actualTimestep, stats);
|
||||
} else {
|
||||
gpuStats.ResetFrame();
|
||||
kernelStats.ResetFrame();
|
||||
}
|
||||
}
|
||||
|
||||
// Let's collect all the throttling and frameskipping logic here.
|
||||
static void DoFrameTiming(bool &throttle, bool &skipFrame, float timestep) {
|
||||
PROFILE_THIS_SCOPE("timing");
|
||||
@@ -509,8 +522,6 @@ static void DoFrameTiming(bool &throttle, bool &skipFrame, float timestep) {
|
||||
|
||||
if (lastFrameTime == 0.0 || wasPaused) {
|
||||
nextFrameTime = time_now_d() + scaledTimestep;
|
||||
if (wasPaused)
|
||||
wasPaused = false;
|
||||
} else {
|
||||
// Advance lastFrameTime by a constant amount each frame,
|
||||
// but don't let it get too far behind as things can get very jumpy.
|
||||
@@ -520,6 +531,10 @@ static void DoFrameTiming(bool &throttle, bool &skipFrame, float timestep) {
|
||||
}
|
||||
curFrameTime = time_now_d();
|
||||
|
||||
if (g_Config.bLogFrameDrops) {
|
||||
DoFrameDropLogging(scaledTimestep);
|
||||
}
|
||||
|
||||
// Auto-frameskip automatically if speed limit is set differently than the default.
|
||||
bool useAutoFrameskip = g_Config.bAutoFrameSkip && g_Config.iRenderingMode != FB_NON_BUFFERED_MODE;
|
||||
if (g_Config.bAutoFrameSkip || (g_Config.iFrameSkip == 0 && fpsLimiter == FPS_LIMIT_CUSTOM && g_Config.iFpsLimit > 60)) {
|
||||
@@ -556,6 +571,7 @@ static void DoFrameTiming(bool &throttle, bool &skipFrame, float timestep) {
|
||||
}
|
||||
|
||||
lastFrameTime = nextFrameTime;
|
||||
wasPaused = false;
|
||||
}
|
||||
|
||||
static void DoFrameIdleTiming() {
|
||||
|
||||
Reference in new issue
Block a user