1
1
#include " Renderer.hpp"
2
2
#include " ../Compositor.hpp"
3
3
#include " ../helpers/math/Math.hpp"
4
- #include " ../helpers/sync/SyncReleaser.hpp"
5
4
#include < algorithm>
6
5
#include < aquamarine/output/Output.hpp>
7
6
#include < filesystem>
@@ -1543,25 +1542,6 @@ bool CHyprRenderer::commitPendingAndDoExplicitSync(PHLMONITOR pMonitor) {
1543
1542
}
1544
1543
}
1545
1544
1546
- auto explicitOptions = getExplicitSyncSettings (pMonitor->output );
1547
- if (!explicitOptions.explicitEnabled )
1548
- return ok;
1549
-
1550
- Debug::log (TRACE, " Explicit: {} presented" , explicitPresented.size ());
1551
-
1552
- if (!pMonitor->eglSync )
1553
- Debug::log (TRACE, " Explicit: can't add sync, monitor has no EGLSync" );
1554
- else {
1555
- for (auto const & e : explicitPresented) {
1556
- if (!e->current .buffer || !e->current .buffer ->syncReleaser )
1557
- continue ;
1558
-
1559
- e->current .buffer ->syncReleaser ->addReleaseSync (pMonitor->eglSync );
1560
- }
1561
- }
1562
-
1563
- explicitPresented.clear ();
1564
-
1565
1545
return ok;
1566
1546
}
1567
1547
@@ -2290,6 +2270,11 @@ void CHyprRenderer::endRender() {
2290
2270
return ;
2291
2271
}
2292
2272
2273
+ // release all CHLBufferRefernce (with buf locks) when EGLSync is signalled,
2274
+ // meaning that when opengl rendering is done we send release for all used buffers
2275
+ PMONITOR->inTimeline ->addWaiter ([prevbfs = std::move (usedBuffers)]() mutable { prevbfs.clear (); }, PMONITOR->inTimelinePoint , 0u );
2276
+ usedBuffers.clear ();
2277
+
2293
2278
if (m_eRenderMode == RENDER_MODE_NORMAL && explicitOptions.explicitKMSEnabled ) {
2294
2279
PMONITOR->inFence = CFileDescriptor{PMONITOR->inTimeline ->exportAsSyncFileFD (PMONITOR->inTimelinePoint )};
2295
2280
if (!PMONITOR->inFence .isValid ()) {
@@ -2304,6 +2289,8 @@ void CHyprRenderer::endRender() {
2304
2289
glFinish ();
2305
2290
else
2306
2291
glFlush ();
2292
+
2293
+ usedBuffers.clear ();
2307
2294
}
2308
2295
}
2309
2296
0 commit comments