diff options
author | Liam <byteslice@airmail.cc> | 2024-02-15 05:44:05 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2024-02-18 00:08:38 +0100 |
commit | 812f23d05c77fb10407546c3e7a95447fcbea395 (patch) | |
tree | bbfb035c35ccffb6dbe0995002c2937bd94edc2d /src/core/hle/service/vi/conductor.h | |
parent | vi: move shared buffer management from nvnflinger (diff) | |
download | yuzu-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 'src/core/hle/service/vi/conductor.h')
-rw-r--r-- | src/core/hle/service/vi/conductor.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/core/hle/service/vi/conductor.h b/src/core/hle/service/vi/conductor.h new file mode 100644 index 000000000..52e3595d2 --- /dev/null +++ b/src/core/hle/service/vi/conductor.h @@ -0,0 +1,57 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include <memory> +#include <unordered_map> + +#include "common/common_types.h" +#include "common/polyfill_thread.h" +#include "common/thread.h" + +namespace Core { +class System; +} + +namespace Core::Timing { +struct EventType; +} + +namespace Service { +class Event; +} + +namespace Service::VI { + +class Container; +class DisplayList; +class VsyncManager; + +class Conductor { +public: + explicit Conductor(Core::System& system, Container& container, DisplayList& displays); + ~Conductor(); + + void LinkVsyncEvent(u64 display_id, Event* event); + void UnlinkVsyncEvent(u64 display_id, Event* event); + +private: + void ProcessVsync(); + void VsyncThread(std::stop_token token); + s64 GetNextTicks() const; + +private: + Core::System& m_system; + Container& m_container; + std::unordered_map<u64, VsyncManager> m_vsync_managers; + std::shared_ptr<Core::Timing::EventType> m_event; + Common::Event m_signal; + std::jthread m_thread; + +private: + s32 m_swap_interval = 1; + f32 m_compose_speed_scale = 1.0f; +}; + +} // namespace Service::VI |