summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar ameerj2021-07-22 21:03:50 -0400
committerGravatar ameerj2021-07-23 22:04:36 -0400
commit2c6e274b3978ce4ee1af98e21f101e7037ec9d24 (patch)
tree3342199a569d656ed23b0d2407c01f939066aaed /src/core
parentMerge pull request #6686 from ReinUsesLisp/vk-optimal-copy (diff)
downloadyuzu-2c6e274b3978ce4ee1af98e21f101e7037ec9d24.tar.gz
yuzu-2c6e274b3978ce4ee1af98e21f101e7037ec9d24.tar.xz
yuzu-2c6e274b3978ce4ee1af98e21f101e7037ec9d24.zip
config, nvflinger: Add FPS cap setting
Allows finer tuning of the FPS limit.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/nvflinger/nvflinger.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp
index 1d810562f..941748970 100644
--- a/src/core/hle/service/nvflinger/nvflinger.cpp
+++ b/src/core/hle/service/nvflinger/nvflinger.cpp
@@ -307,11 +307,12 @@ void NVFlinger::Compose() {
307} 307}
308 308
309s64 NVFlinger::GetNextTicks() const { 309s64 NVFlinger::GetNextTicks() const {
310 if (Settings::values.disable_fps_limit.GetValue()) { 310 static constexpr s64 max_hertz = 120LL;
311 return 0; 311
312 } 312 const auto& settings = Settings::values;
313 constexpr s64 max_hertz = 120LL; 313 const bool unlocked_fps = settings.disable_fps_limit.GetValue();
314 return (1000000000 * (1LL << swap_interval)) / max_hertz; 314 const s64 fps_cap = unlocked_fps ? static_cast<s64>(settings.fps_cap.GetValue()) : 1;
315 return (1000000000 * (1LL << swap_interval)) / (max_hertz * fps_cap);
315} 316}
316 317
317} // namespace Service::NVFlinger 318} // namespace Service::NVFlinger