From 628961295859684dacb7eddb3fd21f5b89ab9b51 Mon Sep 17 00:00:00 2001 From: UjinT34 <41110182+UjinT34@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:15:04 +0300 Subject: [PATCH] reset explicit fences before commit (#6841) --- src/render/Renderer.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 90e3ea65..01fd1922 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -1451,6 +1451,8 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) { bool CHyprRenderer::commitPendingAndDoExplicitSync(CMonitor* pMonitor) { // apply timelines for explicit sync + pMonitor->output->state->resetExplicitFences(); + bool anyExplicit = !explicitPresented.empty(); if (anyExplicit) { Debug::log(TRACE, "Explicit sync presented begin"); @@ -1478,10 +1480,7 @@ bool CHyprRenderer::commitPendingAndDoExplicitSync(CMonitor* pMonitor) { pMonitor->lastWaitPoint = 0; - const auto COMMITTED_OUT = pMonitor->output->state->state().explicitOutFence; - const auto COMMITTED_IN = pMonitor->output->state->state().explicitInFence; - - bool commited = pMonitor->state.commit(); + bool commited = pMonitor->state.commit(); if (!commited) { Debug::log(TRACE, "Monitor state commit failed"); // rollback the buffer to avoid writing to the front buffer that is being @@ -1490,13 +1489,13 @@ bool CHyprRenderer::commitPendingAndDoExplicitSync(CMonitor* pMonitor) { pMonitor->damage.damageEntire(); } - if (COMMITTED_IN >= 0) - close(COMMITTED_IN); + if (pMonitor->output->state->state().explicitInFence >= 0) + close(pMonitor->output->state->state().explicitInFence); - if (COMMITTED_OUT >= 0) { + if (pMonitor->output->state->state().explicitOutFence >= 0) { if (commited) - pMonitor->outTimeline->importFromSyncFileFD(pMonitor->commitSeq, COMMITTED_OUT); - close(COMMITTED_OUT); + pMonitor->outTimeline->importFromSyncFileFD(pMonitor->commitSeq, pMonitor->output->state->state().explicitOutFence); + close(pMonitor->output->state->state().explicitOutFence); } return commited;