aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-04-08 17:22:53 +0100
committerVaxry <[email protected]>2024-04-08 17:22:53 +0100
commitefad5087b487557a89f5fea69504eb69b5f77421 (patch)
tree06d9948760166826879f265b7bb69cbcb07671ff
parenta182c3b18f3f7363db39c8280096a02afc7878d6 (diff)
downloadHyprland-efad5087b487557a89f5fea69504eb69b5f77421.tar.gz
Hyprland-efad5087b487557a89f5fea69504eb69b5f77421.zip
cock
-rw-r--r--src/managers/FrameSchedulingManager.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/managers/FrameSchedulingManager.cpp b/src/managers/FrameSchedulingManager.cpp
index 956c5e20..00221ea8 100644
--- a/src/managers/FrameSchedulingManager.cpp
+++ b/src/managers/FrameSchedulingManager.cpp
@@ -129,6 +129,11 @@ 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
@@ -184,13 +189,15 @@ void CFrameSchedulingManager::onPresent(CMonitor* pMonitor, wlr_output_event_pre
µsUntilVblank = std::chrono::duration_cast<std::chrono::microseconds>(DATA->nextVblank - std::chrono::system_clock::now()).count();
if (µsUntilVblank > 100)
- DATA->vblankTimer->updateTimeout(std::chrono::microseconds(µsUntilVblank - 100));
+ DATA->vblankTimer->updateTimeout(std::chrono::microseconds(µsUntilVblank / 2));
Debug::log(LOG, "until vblank {}µs", µsUntilVblank);
renderMonitor(DATA);
#ifndef GLES2
+ g_pHyprRenderer->makeEGLCurrent();
+
DATA->fenceSync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
#endif
}