summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Englund <tomenglund26@gmail.com>2026-05-02 17:24:20 +0200
committerGitHub <noreply@github.com>2026-05-02 16:24:20 +0100
commitc3e07986cc1afad0e69d30ac7817d7831f2d1c22 (patch)
tree1c6a4c20d2bba49035dd86bc920fcef84adb187f
parentc065e951d631a3aa3736b45f17b3556597f63c1a (diff)
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.
-rw-r--r--src/render/Renderer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index b5a32a2b..6800c185 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);