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:
parent
5d005f11fa
commit
2ee5118d7a
14 changed files with 119 additions and 161 deletions
|
|
@ -221,21 +221,11 @@ void CScreencopyFrame::copyDmabuf(std::function<void(bool)> callback) {
|
|||
}
|
||||
|
||||
g_pHyprOpenGL->m_RenderData.blockScreenShader = true;
|
||||
g_pHyprRenderer->endRender();
|
||||
|
||||
auto explicitOptions = g_pHyprRenderer->getExplicitSyncSettings(pMonitor->output);
|
||||
if (pMonitor->inTimeline && explicitOptions.explicitEnabled) {
|
||||
if (pMonitor->inTimeline->addWaiter(
|
||||
[callback, sync = pMonitor->eglSync]() {
|
||||
LOGM(TRACE, "Copied frame via dma with explicit sync");
|
||||
callback(true);
|
||||
},
|
||||
pMonitor->inTimelinePoint, 0))
|
||||
return;
|
||||
// on explicit sync failure, fallthrough to immediate callback
|
||||
}
|
||||
LOGM(TRACE, "Copied frame via dma");
|
||||
callback(true);
|
||||
g_pHyprRenderer->endRender([callback]() {
|
||||
LOGM(TRACE, "Copied frame via dma");
|
||||
callback(true);
|
||||
});
|
||||
}
|
||||
|
||||
bool CScreencopyFrame::copyShm() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue