diff options
| author | 2021-07-25 16:23:44 -0700 | |
|---|---|---|
| committer | 2021-07-25 16:23:44 -0700 | |
| commit | c09557acd8a1880b0f19cc13d5fde46186363c3d (patch) | |
| tree | 2e1ddda5bd411f69d90c8efd214910aec3ec9b06 /src/core/hle | |
| parent | Merge pull request #6575 from FernandoS27/new_settings (diff) | |
| parent | config, nvflinger: Add FPS cap setting (diff) | |
| download | yuzu-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.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() { | |||
| 307 | } | 307 | } |
| 308 | 308 | ||
| 309 | s64 NVFlinger::GetNextTicks() const { | 309 | s64 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 |