diff options
author | bunnei <bunneidev@gmail.com> | 2022-07-17 22:59:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-17 22:59:52 +0200 |
commit | ba8ea956242537d862b4f9b5d27b95a5a6928ea7 (patch) | |
tree | f776066179ea4c1e2671ff3dc3811ed7301261a9 /src/core | |
parent | Merge pull request #8544 from german77/14dot0 (diff) | |
parent | hle: service: nvflinger: Fix implicit conversion. (diff) | |
download | yuzu-ba8ea956242537d862b4f9b5d27b95a5a6928ea7.tar yuzu-ba8ea956242537d862b4f9b5d27b95a5a6928ea7.tar.gz yuzu-ba8ea956242537d862b4f9b5d27b95a5a6928ea7.tar.bz2 yuzu-ba8ea956242537d862b4f9b5d27b95a5a6928ea7.tar.lz yuzu-ba8ea956242537d862b4f9b5d27b95a5a6928ea7.tar.xz yuzu-ba8ea956242537d862b4f9b5d27b95a5a6928ea7.tar.zst yuzu-ba8ea956242537d862b4f9b5d27b95a5a6928ea7.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/hle/service/nvflinger/nvflinger.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp index 5f69c8c2c..5574269eb 100644 --- a/src/core/hle/service/nvflinger/nvflinger.cpp +++ b/src/core/hle/service/nvflinger/nvflinger.cpp @@ -287,9 +287,21 @@ s64 NVFlinger::GetNextTicks() const { static constexpr s64 max_hertz = 120LL; const auto& settings = Settings::values; - const bool unlocked_fps = settings.disable_fps_limit.GetValue(); - const s64 fps_cap = unlocked_fps ? static_cast<s64>(settings.fps_cap.GetValue()) : 1; - return (1000000000 * (1LL << swap_interval)) / (max_hertz * fps_cap); + auto speed_scale = 1.f; + if (settings.use_multi_core.GetValue()) { + if (settings.use_speed_limit.GetValue()) { + // Scales the speed based on speed_limit setting on MC. SC is handled by + // SpeedLimiter::DoSpeedLimiting. + speed_scale = 100.f / settings.speed_limit.GetValue(); + } else { + // Run at unlocked framerate. + speed_scale = 0.01f; + } + } + + const auto next_ticks = ((1000000000 * (1LL << swap_interval)) / max_hertz); + + return static_cast<s64>(speed_scale * static_cast<float>(next_ticks)); } } // namespace Service::NVFlinger |