mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-01-01 18:48:27 +00:00
Merge pull request #8892 from unknownbrackets/display
Display: Flip at least once every 10 frames
This commit is contained in:
commit
4427fcc8d8
@ -625,23 +625,30 @@ void hleEnterVblank(u64 userdata, int cyclesLate) {
|
|||||||
// We flip only if the framebuffer was dirty. This eliminates flicker when using
|
// We flip only if the framebuffer was dirty. This eliminates flicker when using
|
||||||
// non-buffered rendering. The interaction with frame skipping seems to need
|
// non-buffered rendering. The interaction with frame skipping seems to need
|
||||||
// some work.
|
// some work.
|
||||||
// But, let's flip at least once every 10 frames if possible, since there may be sound effects.
|
// But, let's flip at least once every 10 vblanks, to update fps, etc.
|
||||||
if (gpu->FramebufferDirty() || (g_Config.iRenderingMode != 0 && numVBlanksSinceFlip >= 10)) {
|
const bool noRecentFlip = g_Config.iRenderingMode != FB_NON_BUFFERED_MODE && numVBlanksSinceFlip >= 10;
|
||||||
|
const bool fbDirty = gpu->FramebufferDirty();
|
||||||
|
if (fbDirty || noRecentFlip) {
|
||||||
if (g_Config.iShowFPSCounter && g_Config.iShowFPSCounter < 4) {
|
if (g_Config.iShowFPSCounter && g_Config.iShowFPSCounter < 4) {
|
||||||
CalculateFPS();
|
CalculateFPS();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setting CORE_NEXTFRAME causes a swap.
|
// Setting CORE_NEXTFRAME causes a swap.
|
||||||
// Check first though, might've just quit / been paused.
|
// Check first though, might've just quit / been paused.
|
||||||
if (gpu->FramebufferReallyDirty()) {
|
const bool fbReallyDirty = gpu->FramebufferReallyDirty();
|
||||||
|
if (fbReallyDirty || noRecentFlip) {
|
||||||
if (coreState == CORE_RUNNING) {
|
if (coreState == CORE_RUNNING) {
|
||||||
coreState = CORE_NEXTFRAME;
|
coreState = CORE_NEXTFRAME;
|
||||||
gpu->CopyDisplayToOutput();
|
gpu->CopyDisplayToOutput();
|
||||||
actualFlips++;
|
if (fbReallyDirty) {
|
||||||
|
actualFlips++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gpuStats.numFlips++;
|
if (fbDirty) {
|
||||||
|
gpuStats.numFlips++;
|
||||||
|
}
|
||||||
|
|
||||||
bool throttle, skipFrame;
|
bool throttle, skipFrame;
|
||||||
DoFrameTiming(throttle, skipFrame, (float)numVBlanksSinceFlip * timePerVblank);
|
DoFrameTiming(throttle, skipFrame, (float)numVBlanksSinceFlip * timePerVblank);
|
||||||
|
Loading…
Reference in New Issue
Block a user