mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-04 11:43:47 +01:00
Core: Reduce frame idle delay.
Otherwise we only have a single vblank of time left. Sometimes that's not enough. Effectively, this makes us only sleep one vblank at a time.
This commit is contained in:
1 parent
33db883024
commit
cf37da47ba
1 file changed
+3
-4
@@ -596,10 +596,9 @@ static void DoFrameIdleTiming() {
|
||||
|
||||
// If we have over at least a vblank of spare time, maintain at least 30fps in delay.
|
||||
// This prevents fast forward during loading screens.
|
||||
const double thresh = lastFrameTime + (numVBlanksSinceFlip - 1) * scaledVblank;
|
||||
if (numVBlanksSinceFlip >= 2 && time_now_d() < thresh) {
|
||||
// Give a little extra wiggle room in case the next vblank does more work.
|
||||
const double goal = lastFrameTime + numVBlanksSinceFlip * scaledVblank - 0.001;
|
||||
// Give a little extra wiggle room in case the next vblank does more work.
|
||||
const double goal = lastFrameTime + (numVBlanksSinceFlip - 1) * scaledVblank - 0.001;
|
||||
if (numVBlanksSinceFlip >= 2 && time_now_d() < goal) {
|
||||
while (time_now_d() < goal) {
|
||||
#ifdef _WIN32
|
||||
sleep_ms(1);
|
||||
|
||||
Reference in new issue
Block a user