diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:03:50 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-24 04:04:36 +0200 |
commit | 2c6e274b3978ce4ee1af98e21f101e7037ec9d24 (patch) | |
tree | 3342199a569d656ed23b0d2407c01f939066aaed /src/core/hle/service/nvflinger | |
parent | Merge pull request #6686 from ReinUsesLisp/vk-optimal-copy (diff) | |
download | yuzu-2c6e274b3978ce4ee1af98e21f101e7037ec9d24.tar yuzu-2c6e274b3978ce4ee1af98e21f101e7037ec9d24.tar.gz yuzu-2c6e274b3978ce4ee1af98e21f101e7037ec9d24.tar.bz2 yuzu-2c6e274b3978ce4ee1af98e21f101e7037ec9d24.tar.lz yuzu-2c6e274b3978ce4ee1af98e21f101e7037ec9d24.tar.xz yuzu-2c6e274b3978ce4ee1af98e21f101e7037ec9d24.tar.zst yuzu-2c6e274b3978ce4ee1af98e21f101e7037ec9d24.zip |
Diffstat (limited to 'src/core/hle/service/nvflinger')
-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 |