summaryrefslogtreecommitdiff
path: root/src/helpers/sync/SyncReleaser.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2024-08-06 14:52:19 +0100
committerGitHub <noreply@github.com>2024-08-06 15:52:19 +0200
commit640d1618519d42dd592f7af5e9984ad52eb8b820 (patch)
treef44a5b58822eb60e7fd2dfc3e18af9bba0ab2cb0 /src/helpers/sync/SyncReleaser.cpp
parent0e86808e5912823f1c6bea1b6d5fcae297fc9f57 (diff)
renderer: Explicit sync fixes (#7151)
Enables explicit sync by default for most platforms `misc:no_direct_scanout` -> `render:direct_scanout`
Diffstat (limited to 'src/helpers/sync/SyncReleaser.cpp')
-rw-r--r--src/helpers/sync/SyncReleaser.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/helpers/sync/SyncReleaser.cpp b/src/helpers/sync/SyncReleaser.cpp
new file mode 100644
index 00000000..198495ab
--- /dev/null
+++ b/src/helpers/sync/SyncReleaser.cpp
@@ -0,0 +1,25 @@
+#include "SyncReleaser.hpp"
+#include "SyncTimeline.hpp"
+#include "../../render/OpenGL.hpp"
+
+CSyncReleaser::CSyncReleaser(WP<CSyncTimeline> timeline_, uint64_t point_) : timeline(timeline_), point(point_) {
+ ;
+}
+
+CSyncReleaser::~CSyncReleaser() {
+ if (timeline.expired())
+ return;
+
+ if (sync)
+ timeline->importFromSyncFileFD(point, sync->fd());
+ else
+ timeline->signal(point);
+}
+
+void CSyncReleaser::addReleaseSync(SP<CEGLSync> sync_) {
+ sync = sync_;
+}
+
+void CSyncReleaser::drop() {
+ timeline.reset();
+} \ No newline at end of file