From f6ca4bac51595555916f7403ae178680791f824c Mon Sep 17 00:00:00 2001 From: Tom Englund Date: Thu, 20 Mar 2025 11:39:55 +0100 Subject: syncobj: restore SHM buffer reset (#9675) reset shm buffers early to mitigate stuttering animations, also reuse the monitors eglSync and store the eglsync per monitor. this however reintroduces flickering in dbeaver nonsyncobj application. --- src/render/Renderer.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/render/Renderer.cpp') diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 62e4b77d..b76d67e5 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -1526,21 +1526,19 @@ bool CHyprRenderer::commitPendingAndDoExplicitSync(PHLMONITOR pMonitor) { return ok; Debug::log(TRACE, "Explicit: {} presented", explicitPresented.size()); - auto sync = g_pHyprOpenGL->createEGLSync(pMonitor->inFence.get()); - if (!sync) - Debug::log(TRACE, "Explicit: can't add sync, EGLSync failed"); + if (!pMonitor->eglSync) + Debug::log(TRACE, "Explicit: can't add sync, monitor has no EGLSync"); else { for (auto const& e : explicitPresented) { if (!e->current.buffer || !e->current.buffer->buffer || !e->current.buffer->buffer->syncReleaser) continue; - e->current.buffer->buffer->syncReleaser->addReleaseSync(sync); + e->current.buffer->buffer->syncReleaser->addReleaseSync(pMonitor->eglSync); } } explicitPresented.clear(); - pMonitor->output->state->resetExplicitFences(); return ok; } @@ -2257,13 +2255,13 @@ void CHyprRenderer::endRender() { auto explicitOptions = getExplicitSyncSettings(PMONITOR->output); if (PMONITOR->inTimeline && explicitOptions.explicitEnabled && explicitOptions.explicitKMSEnabled) { - auto sync = g_pHyprOpenGL->createEGLSync(); - if (!sync) { + PMONITOR->eglSync = g_pHyprOpenGL->createEGLSync(); + if (!PMONITOR->eglSync) { Debug::log(ERR, "renderer: couldn't create an EGLSync for out in endRender"); return; } - bool ok = PMONITOR->inTimeline->importFromSyncFileFD(PMONITOR->commitSeq, sync->fd()); + bool ok = PMONITOR->inTimeline->importFromSyncFileFD(PMONITOR->commitSeq, PMONITOR->eglSync->fd()); if (!ok) { Debug::log(ERR, "renderer: couldn't import from sync file fd in endRender"); return; -- cgit v1.2.3