summaryrefslogtreecommitdiff
path: root/src/render/pass/SurfacePassElement.cpp
diff options
context:
space:
mode:
authorIkalco <73481042+ikalco@users.noreply.github.com>2025-04-30 11:35:25 -0500
committerGitHub <noreply@github.com>2025-04-30 18:35:25 +0200
commit2ee5118d7a4a59d3ccfaed305bfc05c79cea7637 (patch)
tree7c113e64071edbc260060df7e60af9c915b3986a /src/render/pass/SurfacePassElement.cpp
parent5d005f11fa218d26ed2cf6ce75cd9aac9c2c00e5 (diff)
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
Diffstat (limited to 'src/render/pass/SurfacePassElement.cpp')
-rw-r--r--src/render/pass/SurfacePassElement.cpp5
1 files changed, 5 insertions, 0 deletions
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);
}