summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nvflinger/nvflinger.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-09-22 15:38:13 +0200
committerGitHub <noreply@github.com>2019-09-22 15:38:13 +0200
commit4ace69de9c90eb7d4a758aa3c3616a9c0d55bc5b (patch)
treecbf3e722bf583a48f851744c8276a2caf0b2e8ef /src/core/hle/service/nvflinger/nvflinger.cpp
parentMerge pull request #2870 from FernandoS27/multi-draw (diff)
parentremoved unneeded semicolon (diff)
downloadyuzu-4ace69de9c90eb7d4a758aa3c3616a9c0d55bc5b.tar
yuzu-4ace69de9c90eb7d4a758aa3c3616a9c0d55bc5b.tar.gz
yuzu-4ace69de9c90eb7d4a758aa3c3616a9c0d55bc5b.tar.bz2
yuzu-4ace69de9c90eb7d4a758aa3c3616a9c0d55bc5b.tar.lz
yuzu-4ace69de9c90eb7d4a758aa3c3616a9c0d55bc5b.tar.xz
yuzu-4ace69de9c90eb7d4a758aa3c3616a9c0d55bc5b.tar.zst
yuzu-4ace69de9c90eb7d4a758aa3c3616a9c0d55bc5b.zip
Diffstat (limited to 'src/core/hle/service/nvflinger/nvflinger.cpp')
-rw-r--r--src/core/hle/service/nvflinger/nvflinger.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp
index f9db79370..2e4d707b9 100644
--- a/src/core/hle/service/nvflinger/nvflinger.cpp
+++ b/src/core/hle/service/nvflinger/nvflinger.cpp
@@ -29,26 +29,28 @@ namespace Service::NVFlinger {
constexpr s64 frame_ticks = static_cast<s64>(Core::Timing::BASE_CLOCK_RATE / 60);
constexpr s64 frame_ticks_30fps = static_cast<s64>(Core::Timing::BASE_CLOCK_RATE / 30);
-NVFlinger::NVFlinger(Core::Timing::CoreTiming& core_timing) : core_timing{core_timing} {
- displays.emplace_back(0, "Default");
- displays.emplace_back(1, "External");
- displays.emplace_back(2, "Edid");
- displays.emplace_back(3, "Internal");
- displays.emplace_back(4, "Null");
+NVFlinger::NVFlinger(Core::System& system) : system(system) {
+ displays.emplace_back(0, "Default", system);
+ displays.emplace_back(1, "External", system);
+ displays.emplace_back(2, "Edid", system);
+ displays.emplace_back(3, "Internal", system);
+ displays.emplace_back(4, "Null", system);
// Schedule the screen composition events
- composition_event = core_timing.RegisterEvent("ScreenComposition", [this](u64 userdata,
- s64 cycles_late) {
- Compose();
- const auto ticks = Settings::values.force_30fps_mode ? frame_ticks_30fps : GetNextTicks();
- this->core_timing.ScheduleEvent(std::max<s64>(0LL, ticks - cycles_late), composition_event);
- });
-
- core_timing.ScheduleEvent(frame_ticks, composition_event);
+ composition_event = system.CoreTiming().RegisterEvent(
+ "ScreenComposition", [this](u64 userdata, s64 cycles_late) {
+ Compose();
+ const auto ticks =
+ Settings::values.force_30fps_mode ? frame_ticks_30fps : GetNextTicks();
+ this->system.CoreTiming().ScheduleEvent(std::max<s64>(0LL, ticks - cycles_late),
+ composition_event);
+ });
+
+ system.CoreTiming().ScheduleEvent(frame_ticks, composition_event);
}
NVFlinger::~NVFlinger() {
- core_timing.UnscheduleEvent(composition_event, 0);
+ system.CoreTiming().UnscheduleEvent(composition_event, 0);
}
void NVFlinger::SetNVDrvInstance(std::shared_ptr<Nvidia::Module> instance) {
@@ -185,11 +187,9 @@ void NVFlinger::Compose() {
MicroProfileFlip();
if (!buffer) {
- auto& system_instance = Core::System::GetInstance();
-
// There was no queued buffer to draw, render previous frame
- system_instance.GetPerfStats().EndGameFrame();
- system_instance.GPU().SwapBuffers({});
+ system.GetPerfStats().EndGameFrame();
+ system.GPU().SwapBuffers({});
continue;
}