mirror of
https://github.com/hyprwm/Hyprland
synced 2026-05-08 17:38:19 +02:00
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:
parent
c065e951d6
commit
c3e07986cc
1 changed files with 3 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue