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.
This commit is contained in:
Tom Englund 2026-05-02 17:24:20 +02:00 committed by GitHub
parent c065e951d6
commit c3e07986cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);