feat(menu): add a 45 FPS game frame rate cap #1585
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1585
Loading…
Reference in a new issue
No description provided.
Delete branch "SonnikBoom/Longshot:feat/45-fps-cap"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: feat · Risk: low · Tested on: CachyOS, RX 9070 XT · Needs: Windows in-game check
TL;DR
Players can choose 45 FPS under Graphics → Game frame rate cap. In two runs in Kokiri Forest, the game averaged 44.999 and 45.000 FPS at normal game speed. The 60 FPS choice averaged 60 FPS on both builds.
Breakdown
Why
The jump from 30 straight to 60 FPS leaves players without a 45 FPS option. A cap at 45 gives players who can sustain that rate another choice. The broader request for more cap options is #1079.
What changed
45 FPS sits between 30 and 60 in the selector. The host paces its own frames at that rate and keeps the game clock in real time, including with Game speed set to Per frame.
gpu/vk/vk_menu.cpp,tx_fps_capshows 45,set_rowcycles the choices in FPS order, andmenu_setting_setaccepts the saved cap ID directly.host/nn_vi.c,fps_refreshresolves the menu selection or the per-run override.hos_vi_native_intervalandrealtime_stepapply the sub-60 display period and game-clock stepping.gpu/vk/fps_stats.haccepts 45 for the FPS display. The game-free checks cover cap mapping, stepping, the frame generation preset path and the counter.Measurements
Verdict: The 45 FPS cap averaged 45.00 FPS with a median interval of 22.22 ms and a 1.000× game clock. At the default 60 FPS cap, both builds averaged 60 FPS. The patch's p99 was 0.95 ms and 0.46 ms higher in the two matched 60 FPS pairs.
Hardware: Ryzen 7 9800X3D, 64 GB RAM, Radeon RX 9070 XT 16 GB, Mesa RADV 26.2.6, CachyOS kernel
7.3.4-1-cachyos, KDE Plasma 6.8.2 Wayland.Scene: Kokiri Forest with the repository's Kokiri-start save, 1920×1080 game output, SDR, game's own upscaler, frame generation and V-Sync off, Game speed Per frame. The Wayland swapchain was 1600×900 for both members of pair 1 and 1280×720 for both members of pair 2.
Method: Both Linux Release builds used the same compiler, sysroot and compilation flags. On each launch, a 250-frame camera sweep warmed the scene before a 20-second standing sample. The order was main, patch, main, patch. On each patch run, a second standing sample followed the live switch from 60 to 45 FPS.
HOS_PRESENT_TRACEprovides host present-return intervals.HOS_FPS_LOGrecords game-clock speed. Physical display timing was outside this test.0f529ccis the tested code revision. Later commits record this comparison and update the guide.How to reproduce: Load Kokiri-start, set the options above, leave
HOS_FPS_MAXunset and enableHOS_PRESENT_TRACEandHOS_FPS_LOG. Warm the scene, record 20 seconds at 60 FPS, then select 45 FPS on the patch build and record another 20 seconds.430eef40f529cc(60 FPS)0f529cc(45 FPS)Both captures show one Right press from 30 FPS on the same Graphics menu row. The capture size is 1280×720, with the same test save and graphics settings.
Flags and settings
45 FPS is an opt-in menu choice and per-run override.
frame_rate_caplongshot_options.ini-1for 30,0for 60,1–6for the higher choices.-2for 45.HOS_FPS_MAXTesting
Tested: On CachyOS with the RX 9070 XT, loaded Kokiri Forest, selected 45 FPS in play and checked the host presents and game-clock rate. Pressing Right from 30 selected 45 in the patched Graphics menu. Restarting the test profile loaded 45 FPS and the live selector accepted 60, 30 and 45. The Longshot guide source check and the measured-configuration format check passed.
python -I -B tests/run_all.pyon Linux reported 718 passed, 45 failed and 17 skipped on main, and 718 passed, 45 failed and 17 skipped on this branch.45 checks failing on both commits
tests/test_bug_report.pytests/test_bug_report_defaults.pytests/test_capture_readback_visibility.pytests/test_cpu_report.pytests/test_crash_groups.pytests/test_crash_record.pytests/test_crt_options.pytests/test_damage_debug_menu.pytests/test_dev_packs.pytests/test_display_startup_failure.pytests/test_dlss_feature_size.pytests/test_draw_stream_visibility.pytests/test_failed_compile_keeps_objects.pytests/test_fsr_image_retirement.pytests/test_fsr_uniform_ownership.pytests/test_guest_imported.pytests/test_hardware_report.pytests/test_hud_layout_row.pytests/test_invalidate_quick.pytests/test_invalidate_vcore.pytests/test_libc_hooks.pytests/test_linux_preflight.pytests/test_linux_pressure.pytests/test_linux_update.pytests/test_log_open_failure.pytests/test_mirror_budget.pytests/test_missing_nup.pytests/test_mods_size_table.pytests/test_nonuniform_image_arrays.pytests/test_parallel_init_order.pytests/test_pending_guest_import.pytests/test_pipeline_play_cache.pytests/test_present_source_crop.pytests/test_present_thread.pytests/test_profiling_mode.pytests/test_psychov35_fsr3_fg.pytests/test_readback_timeout_source.pytests/test_replay_write_order.pytests/test_run_all_changed.pytests/test_slow_frames.pytests/test_staging_burst.pytests/test_switch_table.pytests/test_upscaler_rows.pytests/test_vk_occlusion_queries.pytests/test_walk_key.pyThe Windows x64 cross-build with llvm-mingw 20261104 produced the host executable and Vulkan DLL from a build directory with a non-ASCII name.
Not tested: Windows gameplay, V-Sync on and frame generation on. The measurements cover standing gameplay in Kokiri Forest.
Must be tested:
Risks
What could break: Low-cap pacing, game speed or restoration of the prior timing preference on switching back to 60. At 60 FPS, the two short runs show a p99 increase of 0.95 ms and 0.46 ms with the same average FPS. The samples establish the cap behavior and quantify the observed tail difference. They are too short to identify its cause.
Turning it off: Choose 60 FPS in Graphics and clear any per-run
HOS_FPS_MAX=45override.Compatibility: The existing save format, pipeline and shader-cache formats, renderer ABI and builder tooling apply to both builds.
vk_api.hdocuments the existing option ID 53. The options file uses a new cap ID,-2, for 45. Select 60 before switching to an older build if you want that build to restore 60.Issues
Fixes #1548.
See #1079.
Checklist
Everyone
type(scope): description) of the status line's type.can't be run by hand is in Testing's Not testable by hand, with why.
in Risks.
main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.docs/tested/for each new measured run (format indocs/tested-configurations.md).tests/that reads changed source updated in this PR, not weakened.Tested in game: CachyOS (KDE Wayland), Radeon RX 9070 XT with Mesa RADV 26.2.6: in Kokiri Forest the 45 FPS cap measured 44.999 and 45.000 FPS at normal game speed. The test save loaded on restart with 45 FPS still selected.
WIP: feat(menu): add a 45 FPS game frame rate capto feat(menu): add a 45 FPS game frame rate capView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.