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
This commit is contained in:
Ikalco
2025-04-30 11:35:25 -05:00
committed by GitHub
parent 5d005f11fa
commit 2ee5118d7a
14 changed files with 119 additions and 161 deletions

View File

@@ -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);
}