renderer: Tearing implementation (#3441)

This commit is contained in:
Vaxry 2023-09-28 21:48:33 +01:00 committed by GitHub
parent 1e513e25d5
commit 88b63a00b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 231 additions and 61 deletions

View file

@ -149,6 +149,14 @@ void Events::listener_monitorFrame(void* owner, void* data) {
if (!PMONITOR->m_bEnabled)
return;
if (PMONITOR->ignoreNextFlipEvent) {
Debug::log(LOG, "Ignore next flip event for {}", PMONITOR->szName);
PMONITOR->ignoreNextFlipEvent = false;
return;
}
PMONITOR->renderingFromVblankEvent = true;
static auto* const PENABLERAT = &g_pConfigManager->getConfigValuePtr("misc:render_ahead_of_time")->intValue;
static auto* const PRATSAFE = &g_pConfigManager->getConfigValuePtr("misc:render_ahead_safezone")->intValue;
@ -181,6 +189,8 @@ void Events::listener_monitorFrame(void* owner, void* data) {
} else {
g_pHyprRenderer->renderMonitor(PMONITOR);
}
PMONITOR->renderingFromVblankEvent = false;
}
void Events::listener_monitorDestroy(void* owner, void* data) {