diff options
author | bunnei <bunneidev@gmail.com> | 2021-07-26 01:23:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-26 01:23:44 +0200 |
commit | c09557acd8a1880b0f19cc13d5fde46186363c3d (patch) | |
tree | 2e1ddda5bd411f69d90c8efd214910aec3ec9b06 /src/core | |
parent | Merge pull request #6575 from FernandoS27/new_settings (diff) | |
parent | config, nvflinger: Add FPS cap setting (diff) | |
download | yuzu-c09557acd8a1880b0f19cc13d5fde46186363c3d.tar yuzu-c09557acd8a1880b0f19cc13d5fde46186363c3d.tar.gz yuzu-c09557acd8a1880b0f19cc13d5fde46186363c3d.tar.bz2 yuzu-c09557acd8a1880b0f19cc13d5fde46186363c3d.tar.lz yuzu-c09557acd8a1880b0f19cc13d5fde46186363c3d.tar.xz yuzu-c09557acd8a1880b0f19cc13d5fde46186363c3d.tar.zst yuzu-c09557acd8a1880b0f19cc13d5fde46186363c3d.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/hle/service/nvflinger/nvflinger.cpp | 11 |
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() { } s64 NVFlinger::GetNextTicks() const { - if (Settings::values.disable_fps_limit.GetValue()) { - return 0; - } - constexpr s64 max_hertz = 120LL; - return (1000000000 * (1LL << swap_interval)) / max_hertz; + 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); } } // namespace Service::NVFlinger |