This commit is contained in:
Vaxry 2024-04-08 17:42:12 +01:00
parent 44f75ee329
commit 4edb12f953

View file

@ -131,11 +131,6 @@ void CFrameSchedulingManager::onPresent(CMonitor* pMonitor, wlr_output_event_pre
RASSERT(DATA, "No data in onPresent");
if (DATA->fenceSync) {
glDeleteSync(DATA->fenceSync);
DATA->fenceSync = nullptr;
}
if (pMonitor->tearingState.activelyTearing || DATA->legacyScheduler) {
DATA->activelyPushing = false;
return; // don't render
@ -146,6 +141,11 @@ void CFrameSchedulingManager::onPresent(CMonitor* pMonitor, wlr_output_event_pre
return;
}
if (DATA->fenceSync) {
glDeleteSync(DATA->fenceSync);
DATA->fenceSync = nullptr;
}
Debug::log(LOG, "Present: del {}", DATA->delayed);
int forceFrames = DATA->forceFrames + pMonitor->forceFullFrames;
@ -265,13 +265,13 @@ void CFrameSchedulingManager::onVblankTimer(void* data) {
Debug::log(LOG, "vblank: signaled {}", GPUSignaled);
if (DATA->rendered && GPUSignaled) {
if (GPUSignaled) {
Debug::log(LOG, "timer nothing");
// cool, we don't need to do anything. Wait for present.
return;
}
if (DATA->rendered && !GPUSignaled) {
if (!GPUSignaled) {
Debug::log(LOG, "timer delay");
// we missed a vblank :(
DATA->delayed = true;