feat(vk): FPS counter overhaul 2: size row, details page, steadier graph, Dev hardware footer #998

Merged
llun merged 13 commits from ballotstomper/Longshot:feat/fps-counter-overhaul-2 into main 2026-11-16 01:49:50 +00:00
Contributor

Type: feat · Risk: low · Tested on: Linux, RX 6750 XT · Needs: Windows, any GPU

Why

The FPS counter got its Breakdown graph in #928. This is the second round, from using it while recording and profiling:

  • The counter only follows the menu size. Some people want it smaller over their videos, or larger to read on a TV, without changing the menu.
  • The 16.7 ms cap line disappears behind tall columns.
  • The red peak marks jump around, and the graph's scale shakes whenever a frame scrolls out.
  • Two of the Breakdown's parts were misattributed:
    • The present's wait for the main thread's signal counted as Renderer.
    • The render thread's one-frame-ahead room wait counted as game time.
  • Bug reports keep asking for the build and hardware. A screenshot at Dev should already show the version, CPU, GPU and driver.
  • The Dev level lacked the numbers we look at most: GPU slot waits, queue submits and write-backs. With more lines, Dev also needed a way to hide the ones you don't want, and a layout that stays on screen.

See #928.

What changed

The counter gets a size row and a details page for the Dev level. The graph's cap line, peak marks and scale are steadier. The Breakdown puts two waits where they belong. Dev gains three rows and a footer with the version and hardware.

  • Size: a new "FPS counter size" row (Auto by default, Small, Medium, Large). fps_scale() in gpu/vk/vk_menu.cpp uses fixed scales, capped at what Auto gives at the Large menu size.
  • Graph (draw_fps):
    • The cap line is drawn after the columns, in the graph and the render lane.
    • Red peak marks are keyed by frame time, so they stay on their frame.
    • The scale decays by time instead of by frame: up at once, down 0.5% a 60th of a second.
  • Breakdown accuracy:
    • A new part, "Game's main thread" under Waiting on: FpsWait main_wait(kWaitMain) in present() (gpu/vk/vk_replay.cpp). fps_stats::split() in gpu/vk/fps_stats.h takes it as a new argument.
    • The room wait in enqueue for a present now counts as Render thread (kWaitRender).
    • The Renderer naming stays.
  • Dev level:
    • New rows: GPU slot waits, Queue submits and Write-backs (fps_texts, DevLine in fps_stats.h).
    • The lines are laid out two to a row by their measured width. A line too wide for half the column takes a row of its own, with hysteresis so it doesn't flip back and forth.
    • A footer at the bottom of the column shows the version, then the CPU, the GPU and the driver on their own lines.
  • Details page: "FPS counter details" opens from the Gameplay tab (TAB_FPS_DEV, built like the Motion page). It has:
    • an on/off toggle for each Dev line and for the CPU and GPU lines, all on by default;
    • "Version and hardware at every level" (off by default), which shows the footer at every level, not only at Dev.
  • Translations for every new row and help text in gpu/vk/menu_i18n.h, all 13 languages. The README's options table and FPS counter section are updated.

Measurements

Verdict: Not measured. This is a display change, and nothing changes at the Off level. At Dev it adds three counters read once a frame and a few more text lines.

Flags and settings

Two new menu rows and their ini keys. No switches.

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
FPS counter size (fps_counter_size) The counter's scale (follows the menu) Auto Auto follows the menu size; Small, Medium and Large are fixed Helps for recording Auto
FPS counter details (version_and_hardware_at_every_level, vram_line … write-backs_line, cpu_and_gpu_lines) Which Dev lines show, and the footer at every level — Footer off at lower levels, every line on Hides lines, shows the footer Helps when Dev gets long Defaults

Testing

Tested:

  • Game-free: python -I -B tests/run_all.py (567 passed, 11 failed). All 11 failures also fail on main on this PC: test_crt_options, test_guest_imported, test_linux_preflight, test_linux_update, test_make_game_cache, test_missing_nup, test_mods_size_table, test_pending_guest_import, test_run_all_changed, test_vk_occlusion_queries and test_walk_key. test_fps_stats has a new check for the main thread's wait.
  • In the game, RX 6750 XT, Mesa 26.2.7, Arch Linux:
    • each size;
    • every level from Off to Dev;
    • the details page's toggles;
    • the version and hardware footer: only at Dev, and at every level with the toggle on;
    • Dev lines with wide values (Textures "2089, 3.9 GB", Write-backs "62.5 MB") taking their own row;
    • Threaded rendering on and off.

Not tested:

  • Windows: the CPU and GPU names come from the same code that writes them to the log, so nothing here is Linux-only.
  • NVIDIA and Intel driver strings in the footer, which may be longer.

Must be tested:

  • Windows, any GPU: set the FPS counter to Dev and check that the footer shows the version, CPU, GPU and driver on separate lines inside the column, and that the details page's toggles hide their lines. (Test Farm: @Beanstalk windows, FPS counter at Dev, look at the footer)

Risks

What could break:

  • The counter's layout at unusual sizes, such as Large in a small window. The size is capped at what Auto would give.
  • The menu's page navigation on the new details page (Back, the tab strip).

Turning it off: revert the commit. The counter's Off level is unchanged.

Compatibility: longshot_options.ini gains the new keys. Older files load with the defaults. Nothing else changes.

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value.
  • Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Docs updated.
**Type:** feat · **Risk:** low · **Tested on:** Linux, RX 6750 XT · **Needs:** Windows, any GPU ## Why The FPS counter got its Breakdown graph in #928. This is the second round, from using it while recording and profiling: - The counter only follows the menu size. Some people want it smaller over their videos, or larger to read on a TV, without changing the menu. - The 16.7 ms cap line disappears behind tall columns. - The red peak marks jump around, and the graph's scale shakes whenever a frame scrolls out. - Two of the Breakdown's parts were misattributed: - The present's wait for the main thread's signal counted as Renderer. - The render thread's one-frame-ahead room wait counted as game time. - Bug reports keep asking for the build and hardware. A screenshot at Dev should already show the version, CPU, GPU and driver. - The Dev level lacked the numbers we look at most: GPU slot waits, queue submits and write-backs. With more lines, Dev also needed a way to hide the ones you don't want, and a layout that stays on screen. See #928. ## What changed The counter gets a size row and a details page for the Dev level. The graph's cap line, peak marks and scale are steadier. The Breakdown puts two waits where they belong. Dev gains three rows and a footer with the version and hardware. - Size: a new "FPS counter size" row (Auto by default, Small, Medium, Large). `fps_scale()` in `gpu/vk/vk_menu.cpp` uses fixed scales, capped at what Auto gives at the Large menu size. - Graph (`draw_fps`): - The cap line is drawn after the columns, in the graph and the render lane. - Red peak marks are keyed by frame time, so they stay on their frame. - The scale decays by time instead of by frame: up at once, down 0.5% a 60th of a second. - Breakdown accuracy: - A new part, "Game's main thread" under Waiting on: `FpsWait main_wait(kWaitMain)` in `present()` (`gpu/vk/vk_replay.cpp`). `fps_stats::split()` in `gpu/vk/fps_stats.h` takes it as a new argument. - The room wait in `enqueue` for a present now counts as Render thread (`kWaitRender`). - The Renderer naming stays. - Dev level: - New rows: GPU slot waits, Queue submits and Write-backs (`fps_texts`, `DevLine` in `fps_stats.h`). - The lines are laid out two to a row by their measured width. A line too wide for half the column takes a row of its own, with hysteresis so it doesn't flip back and forth. - A footer at the bottom of the column shows the version, then the CPU, the GPU and the driver on their own lines. - Details page: "FPS counter details" opens from the Gameplay tab (`TAB_FPS_DEV`, built like the Motion page). It has: - an on/off toggle for each Dev line and for the CPU and GPU lines, all on by default; - "Version and hardware at every level" (off by default), which shows the footer at every level, not only at Dev. - Translations for every new row and help text in `gpu/vk/menu_i18n.h`, all 13 languages. The README's options table and FPS counter section are updated. ## Measurements **Verdict:** Not measured. This is a display change, and nothing changes at the Off level. At Dev it adds three counters read once a frame and a few more text lines. ### Flags and settings Two new menu rows and their ini keys. No switches. | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | FPS counter size (`fps_counter_size`) | The counter's scale | (follows the menu) | Auto | Auto follows the menu size; Small, Medium and Large are fixed | Helps for recording | Auto | | FPS counter details (`version_and_hardware_at_every_level`, `vram_line` … `write-backs_line`, `cpu_and_gpu_lines`) | Which Dev lines show, and the footer at every level | — | Footer off at lower levels, every line on | Hides lines, shows the footer | Helps when Dev gets long | Defaults | ## Testing **Tested:** - Game-free: `python -I -B tests/run_all.py` (567 passed, 11 failed). All 11 failures also fail on `main` on this PC: test_crt_options, test_guest_imported, test_linux_preflight, test_linux_update, test_make_game_cache, test_missing_nup, test_mods_size_table, test_pending_guest_import, test_run_all_changed, test_vk_occlusion_queries and test_walk_key. test_fps_stats has a new check for the main thread's wait. - In the game, RX 6750 XT, Mesa 26.2.7, Arch Linux: - each size; - every level from Off to Dev; - the details page's toggles; - the version and hardware footer: only at Dev, and at every level with the toggle on; - Dev lines with wide values (Textures "2089, 3.9 GB", Write-backs "62.5 MB") taking their own row; - Threaded rendering on and off. **Not tested:** - Windows: the CPU and GPU names come from the same code that writes them to the log, so nothing here is Linux-only. - NVIDIA and Intel driver strings in the footer, which may be longer. **Must be tested:** - Windows, any GPU: set the FPS counter to Dev and check that the footer shows the version, CPU, GPU and driver on separate lines inside the column, and that the details page's toggles hide their lines. (Test Farm: @Beanstalk windows, FPS counter at Dev, look at the footer) ## Risks **What could break:** - The counter's layout at unusual sizes, such as Large in a small window. The size is capped at what Auto would give. - The menu's page navigation on the new details page (Back, the tab strip). **Turning it off:** revert the commit. The counter's Off level is unchanged. **Compatibility:** `longshot_options.ini` gains the new keys. Older files load with the defaults. Nothing else changes. ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value. - [x] Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Docs updated.
fix(vk): ini keys up to 47 characters, so the version row's key isn't cut
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 4s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
d532406bb5
Author
Contributor

Tested in game: RX 6750 XT, Mesa 26.2.7, Arch Linux: every FPS counter level and size, the details page's toggles, the version and hardware footer (Dev only, and at every level with its toggle), wide Dev values on their own row, Threaded rendering on and off; everything drew as expected.

Tested in game: RX 6750 XT, Mesa 26.2.7, Arch Linux: every FPS counter level and size, the details page's toggles, the version and hardware footer (Dev only, and at every level with its toggle), wide Dev values on their own row, Threaded rendering on and off; everything drew as expected.
Author
Contributor

After: this PR @ d532406b, FPS counter at Dev with the footer and the Dev lines two to a row.

Screenshot_20261116_023338.png

After: this PR @ d532406b, FPS counter at Dev with the footer and the Dev lines two to a row. ![Screenshot_20261116_023338.png](https://git.magicbean.dev/attachments/8d050a28-4b19-4293-9b36-f1b3a960faba)
Collaborator

Possibly related, for context:

  • PR #562 feat(fps): show process CPU and memory in a System counter — Open FPS-counter feature overlaps shared counter drawing, stats, and translations; coordinate changes.
Possibly related, for context: - PR #562 feat(fps): show process CPU and memory in a System counter — Open FPS-counter feature overlaps shared counter drawing, stats, and translations; coordinate changes.
llun approved these changes 2026-11-16 01:44:53 +00:00
Dismissed
Author
Contributor

Rebased onto main @ 9f8958a5 (#773): only menu_i18n.h's per-language counts conflicted, recounted from the arrays. run_all.py --changed: 140 passed, 4 failed, all 4 also failing on main on this PC (test_crt_options, test_walk_key, test_vk_occlusion_queries, and test_bug_report_defaults, which fails on main since #773 with auto-profile: Auto-controlled shadow_res missing).

Rebased onto main @ 9f8958a5 (#773): only menu_i18n.h's per-language counts conflicted, recounted from the arrays. `run_all.py --changed`: 140 passed, 4 failed, all 4 also failing on main on this PC (test_crt_options, test_walk_key, test_vk_occlusion_queries, and test_bug_report_defaults, which fails on main since #773 with `auto-profile: Auto-controlled shadow_res missing`).
ballotstomper force-pushed feat/fps-counter-overhaul-2 from d532406bb5
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 4s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to 48a5c30251
Some checks failed
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Failing after 5s
2026-11-16 01:48:51 +00:00
Compare
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

llun approved these changes 2026-11-16 01:49:36 +00:00
llun changed title from WIP: feat(vk): FPS counter overhaul 2: size row, details page, steadier graph, Dev hardware footer to feat(vk): FPS counter overhaul 2: size row, details page, steadier graph, Dev hardware footer 2026-11-16 01:49:43 +00:00
llun merged commit 1764fed2b2 into main 2026-11-16 01:49:50 +00:00
First-time contributor

@ballotstomper Great update, thanks! One thing the graph on the right still feels jittery. Any chance it could be smoothed out?

@ballotstomper Great update, thanks! One thing the graph on the right still feels jittery. Any chance it could be smoothed out? <video src="/attachments/0df9c5bc-385b-4494-9018-36d0db1990ca" title="longshot_VzMVrj9hpT" controls></video>
Some checks failed
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Failing after 5s
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!998
No description provided.