opengl: add toggleable nvidia_anti_flicker

ref #4252
This commit is contained in:
Vaxry 2023-12-27 19:16:57 +01:00
parent f86cdcf8d5
commit 2702814a3f
2 changed files with 5 additions and 2 deletions

View file

@ -281,6 +281,8 @@ void CConfigManager::setDefaultVars() {
configValues["xwayland:use_nearest_neighbor"].intValue = 1;
configValues["xwayland:force_zero_scaling"].intValue = 0;
configValues["opengl:nvidia_anti_flicker"].intValue = 1;
configValues["autogenerated"].intValue = 0;
}

View file

@ -2419,7 +2419,8 @@ bool CHyprRenderer::beginRender(CMonitor* pMonitor, CRegion& damage, eRenderMode
}
void CHyprRenderer::endRender() {
const auto PMONITOR = g_pHyprOpenGL->m_RenderData.pMonitor;
const auto PMONITOR = g_pHyprOpenGL->m_RenderData.pMonitor;
static auto* const PNVIDIAANTIFLICKER = &g_pConfigManager->getConfigValuePtr("opengl:nvidia_anti_flicker")->intValue;
if (m_eRenderMode != RENDER_MODE_TO_BUFFER_READ_ONLY)
g_pHyprOpenGL->end();
@ -2432,7 +2433,7 @@ void CHyprRenderer::endRender() {
if (m_eRenderMode == RENDER_MODE_FULL_FAKE)
return;
if (isNvidia())
if (isNvidia() && *PNVIDIAANTIFLICKER)
glFinish();
else
glFlush();