summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2022-06-26 13:58:06 -0700
committerGravatar bunnei2022-07-16 23:10:45 -0700
commitf8aaa599907cff765efdaa6f9875cb4c42746870 (patch)
treec0c4806f6e6434224bd3ee6ff7afdec8278b9439
parentMerge pull request #8593 from merryhime/ranged-setting-T (diff)
downloadyuzu-f8aaa599907cff765efdaa6f9875cb4c42746870.tar.gz
yuzu-f8aaa599907cff765efdaa6f9875cb4c42746870.tar.xz
yuzu-f8aaa599907cff765efdaa6f9875cb4c42746870.zip
hle: service: nvflinger: Factor speed limit into frame time calculation.
- This allows the %-based "Limit Speed Percent" setting to work with MC emulation. - This is already supported for SC emulation.
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/nvflinger/nvflinger.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp
index 5f69c8c2c..f92d6beb5 100644
--- a/src/core/hle/service/nvflinger/nvflinger.cpp
+++ b/src/core/hle/service/nvflinger/nvflinger.cpp
@@ -289,7 +289,14 @@ s64 NVFlinger::GetNextTicks() const {
289 const auto& settings = Settings::values; 289 const auto& settings = Settings::values;
290 const bool unlocked_fps = settings.disable_fps_limit.GetValue(); 290 const bool unlocked_fps = settings.disable_fps_limit.GetValue();
291 const s64 fps_cap = unlocked_fps ? static_cast<s64>(settings.fps_cap.GetValue()) : 1; 291 const s64 fps_cap = unlocked_fps ? static_cast<s64>(settings.fps_cap.GetValue()) : 1;
292 return (1000000000 * (1LL << swap_interval)) / (max_hertz * fps_cap); 292 auto speed_scale = 1.f;
293 if (settings.use_speed_limit.GetValue() && settings.use_multi_core.GetValue()) {
294 // Scales the speed based on speed_limit setting on MC. SC is handled by
295 // SpeedLimiter::DoSpeedLimiting.
296 speed_scale = 100.f / settings.speed_limit.GetValue();
297 }
298 return static_cast<s64>(((1000000000 * (1LL << swap_interval)) / (max_hertz * fps_cap)) *
299 speed_scale);
293} 300}
294 301
295} // namespace Service::NVFlinger 302} // namespace Service::NVFlinger