diff options
author | Vaxry <[email protected]> | 2024-08-02 21:23:24 +0200 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-08-03 18:23:44 +0200 |
commit | 753b1b5a43bd82d15a157013167134c33fd70fed (patch) | |
tree | 7fff51f43e33a11d4c2c03bff259343c1e317002 | |
parent | cfecaeb14695f5086646307e2418b08277a7321c (diff) | |
download | Hyprland-753b1b5a43bd82d15a157013167134c33fd70fed.tar.gz Hyprland-753b1b5a43bd82d15a157013167134c33fd70fed.zip |
try2
-rw-r--r-- | src/render/Renderer.cpp | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 3738ca4e..30239ba6 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -2651,7 +2651,36 @@ void CHyprRenderer::endRender() { if (m_eRenderMode == RENDER_MODE_NORMAL) { PMONITOR->output->state->setBuffer(m_pCurrentBuffer); - if (!PMONITOR->inTimeline || !*PENABLEEXPLICIT) { + if (PMONITOR->inTimeline && *PENABLEEXPLICIT) { + auto sync = g_pHyprOpenGL->createEGLSync(-1); + if (!sync) { + m_pCurrentRenderbuffer->unbind(); + m_pCurrentRenderbuffer = nullptr; + m_pCurrentBuffer = nullptr; + Debug::log(ERR, "renderer: couldn't create an EGLSync for out in endRender"); + return; + } + + bool ok = PMONITOR->inTimeline->importFromSyncFileFD(PMONITOR->commitSeq, sync->fd()); + if (!ok) { + m_pCurrentRenderbuffer->unbind(); + m_pCurrentRenderbuffer = nullptr; + m_pCurrentBuffer = nullptr; + Debug::log(ERR, "renderer: couldn't import from sync file fd in endRender"); + return; + } + + auto fd = PMONITOR->inTimeline->exportAsSyncFileFD(PMONITOR->commitSeq); + if (fd <= 0) { + m_pCurrentRenderbuffer->unbind(); + m_pCurrentRenderbuffer = nullptr; + m_pCurrentBuffer = nullptr; + Debug::log(ERR, "renderer: couldn't export from sync timeline in endRender"); + return; + } + + PMONITOR->output->state->setExplicitInFence(fd); + } else { if (isNvidia() && *PNVIDIAANTIFLICKER) glFinish(); else |