summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/vi/vsync_manager.cpp
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2024-02-15 05:44:05 +0100
committerLiam <byteslice@airmail.cc>2024-02-18 00:08:38 +0100
commit812f23d05c77fb10407546c3e7a95447fcbea395 (patch)
treebbfb035c35ccffb6dbe0995002c2937bd94edc2d /src/core/hle/service/vi/vsync_manager.cpp
parentvi: move shared buffer management from nvnflinger (diff)
downloadyuzu-812f23d05c77fb10407546c3e7a95447fcbea395.tar
yuzu-812f23d05c77fb10407546c3e7a95447fcbea395.tar.gz
yuzu-812f23d05c77fb10407546c3e7a95447fcbea395.tar.bz2
yuzu-812f23d05c77fb10407546c3e7a95447fcbea395.tar.lz
yuzu-812f23d05c77fb10407546c3e7a95447fcbea395.tar.xz
yuzu-812f23d05c77fb10407546c3e7a95447fcbea395.tar.zst
yuzu-812f23d05c77fb10407546c3e7a95447fcbea395.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/vi/vsync_manager.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/core/hle/service/vi/vsync_manager.cpp b/src/core/hle/service/vi/vsync_manager.cpp
new file mode 100644
index 000000000..bdc4dfa96
--- /dev/null
+++ b/src/core/hle/service/vi/vsync_manager.cpp
@@ -0,0 +1,26 @@
+// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "core/hle/service/os/event.h"
+#include "core/hle/service/vi/vsync_manager.h"
+
+namespace Service::VI {
+
+VsyncManager::VsyncManager() = default;
+VsyncManager::~VsyncManager() = default;
+
+void VsyncManager::SignalVsync() {
+ for (auto* event : m_vsync_events) {
+ event->Signal();
+ }
+}
+
+void VsyncManager::LinkVsyncEvent(Event* event) {
+ m_vsync_events.insert(event);
+}
+
+void VsyncManager::UnlinkVsyncEvent(Event* event) {
+ m_vsync_events.erase(event);
+}
+
+} // namespace Service::VI