From 2ee5118d7a4a59d3ccfaed305bfc05c79cea7637 Mon Sep 17 00:00:00 2001 From: Ikalco <73481042+ikalco@users.noreply.github.com> Date: Wed, 30 Apr 2025 11:35:25 -0500 Subject: render: properly release rendered buffers (#9807) * cleanup eglSync * properly release buffers in renderer * add renderingDoneCallback and use it in screencopy * use static constructor for CEGLSync --- src/render/pass/SurfacePassElement.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/render/pass') diff --git a/src/render/pass/SurfacePassElement.cpp b/src/render/pass/SurfacePassElement.cpp index c47c76ce..22e61a23 100644 --- a/src/render/pass/SurfacePassElement.cpp +++ b/src/render/pass/SurfacePassElement.cpp @@ -129,6 +129,11 @@ void CSurfacePassElement::draw(const CRegion& damage) { if (!g_pHyprRenderer->m_bBlockSurfaceFeedback) data.surface->presentFeedback(data.when, data.pMonitor->self.lock()); + // add async (dmabuf) buffers to usedBuffers so we can handle release later + // sync (shm) buffers will be released in commitState, so no need to track them here + if (data.surface->current.buffer && !data.surface->current.buffer->isSynchronous()) + g_pHyprRenderer->usedAsyncBuffers.emplace_back(data.surface->current.buffer); + g_pHyprOpenGL->blend(true); } -- cgit v1.2.3