summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-07-16 07:14:00 +0200
committerbunnei <bunneidev@gmail.com>2022-07-17 08:11:39 +0200
commit02282477e739c8db64a13ecb0d1128098b0b0035 (patch)
tree64a97bb378ab91808fcb3c5e0af696c867223d4b /src/core
parenthle: service: nvflinger: Factor speed limit into frame time calculation. (diff)
downloadyuzu-02282477e739c8db64a13ecb0d1128098b0b0035.tar
yuzu-02282477e739c8db64a13ecb0d1128098b0b0035.tar.gz
yuzu-02282477e739c8db64a13ecb0d1128098b0b0035.tar.bz2
yuzu-02282477e739c8db64a13ecb0d1128098b0b0035.tar.lz
yuzu-02282477e739c8db64a13ecb0d1128098b0b0035.tar.xz
yuzu-02282477e739c8db64a13ecb0d1128098b0b0035.tar.zst
yuzu-02282477e739c8db64a13ecb0d1128098b0b0035.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/nvflinger/nvflinger.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp
index f92d6beb5..798c4d3a7 100644
--- a/src/core/hle/service/nvflinger/nvflinger.cpp
+++ b/src/core/hle/service/nvflinger/nvflinger.cpp
@@ -287,16 +287,18 @@ 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;
auto speed_scale = 1.f;
- if (settings.use_speed_limit.GetValue() && settings.use_multi_core.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();
+ 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;
+ }
}
- return static_cast<s64>(((1000000000 * (1LL << swap_interval)) / (max_hertz * fps_cap)) *
- speed_scale);
+ return static_cast<s64>(((1000000000 * (1LL << swap_interval)) / max_hertz) * speed_scale);
}
} // namespace Service::NVFlinger