From c3e07986cc1afad0e69d30ac7817d7831f2d1c22 Mon Sep 17 00:00:00 2001 From: Tom Englund Date: Sat, 2 May 2026 17:24:20 +0200 Subject: [PATCH] renderer: only set presentationmode when required (#14252) if guard the setPresentationMode with the current state, shows up in profiling as minor waste on each frame. --- src/render/Renderer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index b5a32a2b9..6800c1857 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -2145,8 +2145,9 @@ void IHyprRenderer::renderMonitor(PHLMONITOR pMonitor, bool commit) { Event::bus()->m_events.render.stage.emit(RENDER_POST); pMonitor->m_output->state->addDamage(frameDamage); - pMonitor->m_output->state->setPresentationMode(shouldTear ? Aquamarine::eOutputPresentationMode::AQ_OUTPUT_PRESENTATION_IMMEDIATE : - Aquamarine::eOutputPresentationMode::AQ_OUTPUT_PRESENTATION_VSYNC); + auto presentationMode = shouldTear ? Aquamarine::eOutputPresentationMode::AQ_OUTPUT_PRESENTATION_IMMEDIATE : Aquamarine::eOutputPresentationMode::AQ_OUTPUT_PRESENTATION_VSYNC; + if (pMonitor->m_output->state->state().presentationMode != presentationMode) + pMonitor->m_output->state->setPresentationMode(presentationMode); if (commit) commitPendingAndDoExplicitSync(pMonitor);