Permalink
Browse files

Display: Resched interrupt before vblank threads.

Otherwise, we may first schedule to a woken thread, and then immediately
reschedule to the interrupt.  Each reschedule costs ticks, and it doesn't
look like this should cause two reschedules.

Improves #11414, Breath of Fire 3 frame flicker.
  • Loading branch information...
unknownbrackets committed Oct 7, 2018
1 parent ca5adcd commit 014d9ddead570cb3a5da215ea41d43e35c9950c0
Showing with 3 additions and 3 deletions.
  1. +3 −3 Core/HLE/sceDisplay.cpp
View
@@ -645,6 +645,9 @@ void hleEnterVblank(u64 userdata, int cyclesLate) {
CoreTiming::ScheduleEvent(msToCycles(vblankMs) - cyclesLate, leaveVblankEvent, vbCount + 1);
// Trigger VBlank interrupt handlers.
__TriggerInterrupt(PSP_INTR_IMMEDIATE | PSP_INTR_ONLY_IF_ENABLED | PSP_INTR_ALWAYS_RESCHED, PSP_VBLANK_INTR, PSP_INTR_SUB_ALL);
// Wake up threads waiting for VBlank
u32 error;
bool wokeThreads = false;
@@ -663,9 +666,6 @@ void hleEnterVblank(u64 userdata, int cyclesLate) {
__KernelReSchedule("entered vblank");
}
// Trigger VBlank interrupt handlers.
__TriggerInterrupt(PSP_INTR_IMMEDIATE | PSP_INTR_ONLY_IF_ENABLED | PSP_INTR_ALWAYS_RESCHED, PSP_VBLANK_INTR, PSP_INTR_SUB_ALL);
numVBlanks++;
numVBlanksSinceFlip++;

0 comments on commit 014d9dd

Please sign in to comment.