mirror of https://github.com/hyprwm/Hyprland
make explicit sync setting actually disable it
This commit is contained in:
parent
d786094fb9
commit
aa6ae13845
|
@ -1450,6 +1450,8 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CHyprRenderer::commitPendingAndDoExplicitSync(CMonitor* pMonitor) {
|
bool CHyprRenderer::commitPendingAndDoExplicitSync(CMonitor* pMonitor) {
|
||||||
|
static auto PENABLEEXPLICIT = CConfigValue<Hyprlang::INT>("experimental:explicit_sync");
|
||||||
|
|
||||||
// apply timelines for explicit sync
|
// apply timelines for explicit sync
|
||||||
pMonitor->output->state->resetExplicitFences();
|
pMonitor->output->state->resetExplicitFences();
|
||||||
|
|
||||||
|
@ -1480,8 +1482,8 @@ bool CHyprRenderer::commitPendingAndDoExplicitSync(CMonitor* pMonitor) {
|
||||||
|
|
||||||
pMonitor->lastWaitPoint = 0;
|
pMonitor->lastWaitPoint = 0;
|
||||||
|
|
||||||
bool commited = pMonitor->state.commit();
|
bool ok = pMonitor->state.commit();
|
||||||
if (!commited) {
|
if (!ok) {
|
||||||
Debug::log(TRACE, "Monitor state commit failed");
|
Debug::log(TRACE, "Monitor state commit failed");
|
||||||
// rollback the buffer to avoid writing to the front buffer that is being
|
// rollback the buffer to avoid writing to the front buffer that is being
|
||||||
// displayed
|
// displayed
|
||||||
|
@ -1489,16 +1491,19 @@ bool CHyprRenderer::commitPendingAndDoExplicitSync(CMonitor* pMonitor) {
|
||||||
pMonitor->damage.damageEntire();
|
pMonitor->damage.damageEntire();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!*PENABLEEXPLICIT)
|
||||||
|
return ok;
|
||||||
|
|
||||||
if (pMonitor->output->state->state().explicitInFence >= 0)
|
if (pMonitor->output->state->state().explicitInFence >= 0)
|
||||||
close(pMonitor->output->state->state().explicitInFence);
|
close(pMonitor->output->state->state().explicitInFence);
|
||||||
|
|
||||||
if (pMonitor->output->state->state().explicitOutFence >= 0) {
|
if (pMonitor->output->state->state().explicitOutFence >= 0) {
|
||||||
if (commited)
|
if (ok)
|
||||||
pMonitor->outTimeline->importFromSyncFileFD(pMonitor->commitSeq, pMonitor->output->state->state().explicitOutFence);
|
pMonitor->outTimeline->importFromSyncFileFD(pMonitor->commitSeq, pMonitor->output->state->state().explicitOutFence);
|
||||||
close(pMonitor->output->state->state().explicitOutFence);
|
close(pMonitor->output->state->state().explicitOutFence);
|
||||||
}
|
}
|
||||||
|
|
||||||
return commited;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHyprRenderer::renderWorkspace(CMonitor* pMonitor, PHLWORKSPACE pWorkspace, timespec* now, const CBox& geometry) {
|
void CHyprRenderer::renderWorkspace(CMonitor* pMonitor, PHLWORKSPACE pWorkspace, timespec* now, const CBox& geometry) {
|
||||||
|
@ -2680,6 +2685,7 @@ bool CHyprRenderer::beginRender(CMonitor* pMonitor, CRegion& damage, eRenderMode
|
||||||
void CHyprRenderer::endRender() {
|
void CHyprRenderer::endRender() {
|
||||||
const auto PMONITOR = g_pHyprOpenGL->m_RenderData.pMonitor;
|
const auto PMONITOR = g_pHyprOpenGL->m_RenderData.pMonitor;
|
||||||
static auto PNVIDIAANTIFLICKER = CConfigValue<Hyprlang::INT>("opengl:nvidia_anti_flicker");
|
static auto PNVIDIAANTIFLICKER = CConfigValue<Hyprlang::INT>("opengl:nvidia_anti_flicker");
|
||||||
|
static auto PENABLEEXPLICIT = CConfigValue<Hyprlang::INT>("experimental:explicit_sync");
|
||||||
|
|
||||||
PMONITOR->commitSeq++;
|
PMONITOR->commitSeq++;
|
||||||
|
|
||||||
|
@ -2697,7 +2703,7 @@ void CHyprRenderer::endRender() {
|
||||||
if (m_eRenderMode == RENDER_MODE_NORMAL) {
|
if (m_eRenderMode == RENDER_MODE_NORMAL) {
|
||||||
PMONITOR->output->state->setBuffer(m_pCurrentBuffer);
|
PMONITOR->output->state->setBuffer(m_pCurrentBuffer);
|
||||||
|
|
||||||
if (PMONITOR->inTimeline) {
|
if (PMONITOR->inTimeline && *PENABLEEXPLICIT) {
|
||||||
auto sync = g_pHyprOpenGL->createEGLSync(-1);
|
auto sync = g_pHyprOpenGL->createEGLSync(-1);
|
||||||
if (!sync) {
|
if (!sync) {
|
||||||
m_pCurrentRenderbuffer->unbind();
|
m_pCurrentRenderbuffer->unbind();
|
||||||
|
|
Loading…
Reference in New Issue