summaryrefslogtreecommitdiff
path: root/src/core/hle
diff options
context:
space:
mode:
authorGravatar bunnei2021-07-25 16:23:44 -0700
committerGravatar GitHub2021-07-25 16:23:44 -0700
commitc09557acd8a1880b0f19cc13d5fde46186363c3d (patch)
tree2e1ddda5bd411f69d90c8efd214910aec3ec9b06 /src/core/hle
parentMerge pull request #6575 from FernandoS27/new_settings (diff)
parentconfig, nvflinger: Add FPS cap setting (diff)
downloadyuzu-c09557acd8a1880b0f19cc13d5fde46186363c3d.tar.gz
yuzu-c09557acd8a1880b0f19cc13d5fde46186363c3d.tar.xz
yuzu-c09557acd8a1880b0f19cc13d5fde46186363c3d.zip
Merge pull request #6697 from ameerj/fps-cap
config, nvflinger: Add FPS cap setting
Diffstat (limited to 'src/core/hle')
-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