HUD: show real and presented FPS for direct frame generation #390

Open
github-bot wants to merge 2 commits from github-bot/gh-390 into main AGit
Owner

@⁠maple-quartz18 on GitHub · 2026-12-03 23:45 UTC · original
maple-quartz18:feat/direct-framegen-hud → main · +122 −8 · 6 files · 2 commits · open

Summary

In direct FidelityFX frame generation, show real>presented FPS when the current sampling window contains successful generated presents. The presented total is a submission rate, not a measurement of display scanout or input latency. When there are no successful generated presents in the window, keep the plain real-frame rate.

Full and compact modes also retain the average real-frame time, for example 25.0>50.0 FPS 40.0 ms. The head can expand and moves the adjacent badge as needed. FPS-only mode remains rate-only. The frame-time graph and 1% low continue to describe real frames.

The generated-present counter is independent of the periodically reset fg_direct log counters, and only successful presents are counted. Reset the panel sample after hiding the HUD or opening the menu. Non-direct modes keep their existing display.

Validation

  • Windows-target victory-gpu unit tests under Proton: three generated-present rate tests and the full/compact/FPS-only head-format test passed, including no generated frames, disabled direct mode, a counter decrease, and nonzero generated frames.
  • Windows release build passed on the local branch, which also contains other local changes. The two updated files match the PR commit.
  • git diff --check passed.
  • In-game HUD and visual layout have not been verified.
**@⁠maple-quartz18** on GitHub · 2026-12-03 23:45 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/390) `maple-quartz18:feat/direct-framegen-hud` → `main` · +122 −8 · 6 files · 2 commits · open ## Summary In direct FidelityFX frame generation, show `real>presented FPS` when the current sampling window contains successful generated presents. The presented total is a submission rate, not a measurement of display scanout or input latency. When there are no successful generated presents in the window, keep the plain real-frame rate. Full and compact modes also retain the average real-frame time, for example `25.0>50.0 FPS 40.0 ms`. The head can expand and moves the adjacent badge as needed. FPS-only mode remains rate-only. The frame-time graph and 1% low continue to describe real frames. The generated-present counter is independent of the periodically reset `fg_direct` log counters, and only successful presents are counted. Reset the panel sample after hiding the HUD or opening the menu. Non-direct modes keep their existing display. ## Validation - Windows-target `victory-gpu` unit tests under Proton: three generated-present rate tests and the full/compact/FPS-only head-format test passed, including no generated frames, disabled direct mode, a counter decrease, and nonzero generated frames. - Windows release build passed on the local branch, which also contains other local changes. The two updated files match the PR commit. - `git diff --check` passed. - In-game HUD and visual layout have not been verified.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 23:46:51 +00:00
Author
Owner

@⁠Kal0s-design on GitHub · 2026-12-04 03:24 UTC · original

Checked this natively on Windows 11 (MSVC). Both new framegen_rate tests pass, and the rest of the victory-gpu lib matches main (same known native failures). No new clippy warnings.

You said the layout wasn't checked, so I rendered it without the game using the ignored GDI preview test (panel::tests::preview) at 1080p, 1440p and 2160p. "9.4>18.8 FPS" fits in full, compact and FPS-only. I also tried a temporary sample with three-digit values, "119.9>239.8 FPS". It still fits in all three modes, including the FPS-only box at the smallest font step.

The math reads right to me. The generated counter is only bumped on S_OK at the one generated Present (host.rs), and the window is the same one used for real frames. It resets at each refresh and on hide or menu, so the two counts line up. presented_fps can't divide by zero or underflow.

Two small things, not blockers.

  • In full and compact mode the direct-FG head drops the average frame time, since "x>y FPS" replaces "x FPS y ms". Was that intended? The average ms doesn't show up anywhere else on the panel in that mode.
  • direct() only means the API is loaded and the switch is on. With FG idle, or whenever generated presents stop, the head shows something like "30.0>30.0 FPS". Gating on the badge's armed state, or on a non-zero generated delta, would keep the old plain head then.

AI-assisted: yes

**@⁠Kal0s-design** on GitHub · 2026-12-04 03:24 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/390#issuecomment-7400042847) Checked this natively on Windows 11 (MSVC). Both new framegen_rate tests pass, and the rest of the victory-gpu lib matches main (same known native failures). No new clippy warnings. You said the layout wasn't checked, so I rendered it without the game using the ignored GDI preview test (`panel::tests::preview`) at 1080p, 1440p and 2160p. "9.4>18.8 FPS" fits in full, compact and FPS-only. I also tried a temporary sample with three-digit values, "119.9>239.8 FPS". It still fits in all three modes, including the FPS-only box at the smallest font step. The math reads right to me. The generated counter is only bumped on S_OK at the one generated `Present` (host.rs), and the window is the same one used for real frames. It resets at each refresh and on hide or menu, so the two counts line up. `presented_fps` can't divide by zero or underflow. Two small things, not blockers. - In full and compact mode the direct-FG head drops the average frame time, since "x>y FPS" replaces "x FPS y ms". Was that intended? The average ms doesn't show up anywhere else on the panel in that mode. - `direct()` only means the API is loaded and the switch is on. With FG idle, or whenever generated presents stop, the head shows something like "30.0>30.0 FPS". Gating on the badge's armed state, or on a non-zero generated delta, would keep the old plain head then. AI-assisted: yes
Author
Owner

@⁠Luxuride on GitHub · 2026-12-04 11:28 UTC · original

This is sound and I would take it: the counter is bumped only in the status == S_OK arm of a generated present (crates/victory-gpu/src/host.rs:9024), the window used as the divisor is the same one the numerator came from (panel.rs:2228-2231), and a separate non-resetting counter is genuinely needed because direct_line zeroes the existing generated count every interval (crates/victory-gpu/src/framegen.rs:493).

One change before merge: in full HUD mode the head becomes 25.0>50.0 FPS and the frame time disappears, though HEAD_W is documented as sized for "999.9 FPS 9999.9 ms" (panel.rs:958-959). "{:.1}>{:.1} FPS {:.1} ms" keeps what that mode had.

Nits: framegen_rate.rs is a whole #[cfg(windows)] module with docs and two tests for three lines — it belongs in framegen.rs next to the counter it divides; and counter_reset_does_not_underflow names a reset that cannot happen (the counter never resets) — rename it to what it pins.

**@⁠Luxuride** on GitHub · 2026-12-04 11:28 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/390#issuecomment-7410142188) This is sound and I would take it: the counter is bumped only in the `status == S_OK` arm of a generated present (`crates/victory-gpu/src/host.rs:9024`), the window used as the divisor is the same one the numerator came from (`panel.rs:2228-2231`), and a separate non-resetting counter is genuinely needed because `direct_line` zeroes the existing generated count every interval (`crates/victory-gpu/src/framegen.rs:493`). One change before merge: in full HUD mode the head becomes `25.0>50.0 FPS` and the frame time disappears, though `HEAD_W` is documented as sized for "999.9 FPS 9999.9 ms" (`panel.rs:958-959`). `"{:.1}>{:.1} FPS {:.1} ms"` keeps what that mode had. Nits: `framegen_rate.rs` is a whole `#[cfg(windows)]` module with docs and two tests for three lines — it belongs in `framegen.rs` next to the counter it divides; and `counter_reset_does_not_underflow` names a reset that cannot happen (the counter never resets) — rename it to what it pins.
Author
Owner

@⁠maple-quartz18 on GitHub · 2026-12-04 12:19 UTC · original

Checked this natively on Windows 11 (MSVC). Both new framegen_rate tests pass, and the rest of the victory-gpu lib matches main (same known native failures). No new clippy warnings.

You said the layout wasn't checked, so I rendered it without the game using the ignored GDI preview test (panel::tests::preview) at 1080p, 1440p and 2160p. "9.4>18.8 FPS" fits in full, compact and FPS-only. I also tried a temporary sample with three-digit values, "119.9>239.8 FPS". It still fits in all three modes, including the FPS-only box at the smallest font step.

The math reads right to me. The generated counter is only bumped on S_OK at the one generated Present (host.rs), and the window is the same one used for real frames. It resets at each refresh and on hide or menu, so the two counts line up. presented_fps can't divide by zero or underflow.

Two small things, not blockers.

  • In full and compact mode the direct-FG head drops the average frame time, since "x>y FPS" replaces "x FPS y ms". Was that intended? The average ms doesn't show up anywhere else on the panel in that mode.
  • direct() only means the API is loaded and the switch is on. With FG idle, or whenever generated presents stop, the head shows something like "30.0>30.0 FPS". Gating on the badge's armed state, or on a non-zero generated delta, would keep the old plain head then.

AI-assisted: yes

Thanks for your review. I'm fixing

**@⁠maple-quartz18** on GitHub · 2026-12-04 12:19 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/390#issuecomment-7411277417) > Checked this natively on Windows 11 (MSVC). Both new framegen_rate tests pass, and the rest of the victory-gpu lib matches main (same known native failures). No new clippy warnings. > > You said the layout wasn't checked, so I rendered it without the game using the ignored GDI preview test (`panel::tests::preview`) at 1080p, 1440p and 2160p. "9.4>18.8 FPS" fits in full, compact and FPS-only. I also tried a temporary sample with three-digit values, "119.9>239.8 FPS". It still fits in all three modes, including the FPS-only box at the smallest font step. > > The math reads right to me. The generated counter is only bumped on S_OK at the one generated `Present` (host.rs), and the window is the same one used for real frames. It resets at each refresh and on hide or menu, so the two counts line up. `presented_fps` can't divide by zero or underflow. > > Two small things, not blockers. > > * In full and compact mode the direct-FG head drops the average frame time, since "x>y FPS" replaces "x FPS y ms". Was that intended? The average ms doesn't show up anywhere else on the panel in that mode. > * `direct()` only means the API is loaded and the switch is on. With FG idle, or whenever generated presents stop, the head shows something like "30.0>30.0 FPS". Gating on the badge's armed state, or on a non-zero generated delta, would keep the old plain head then. > > AI-assisted: yes Thanks for your review. I'm fixing
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/390/head:github-bot/gh-390'
git switch 'github-bot/gh-390'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-390'
git switch 'github-bot/gh-390'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-390'
git switch 'github-bot/gh-390'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-390'
git switch 'main'
git merge --squash 'github-bot/gh-390'
git switch 'main'
git merge --ff-only 'github-bot/gh-390'
git switch 'main'
git merge 'github-bot/gh-390'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.