On-screen overlay of where the frame goes (F3), logged to overlay.log #717

Open
abilliontokens wants to merge 13 commits from upstream-pr/717 into main
abilliontokens commented 2026-11-25 05:27:41 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by abilliontokens on 2026-11-25T05:27:41Z.


Stacked on #687 (itself stacked on #617): the first eight commits are those PRs'. This PR's own commits are the last four. It merges cleanly into the current main (310c6eb).

What

An on-screen panel of where the frame goes, in every build, shown from the start. F3 hides or shows it while the title's window has the focus; VICTORY_OVERLAY=0 starts with it hidden.

Once a second it shows:

  • the card, window size, uptime, frame number
  • fps, ms/frame, and the last 240 frames' median, 95th percentile, worst and the number over twice the median
  • preparing (copies, texture refreshes and what they waited for), GPU (card busy %, idle behind us), copy-back (and MB the CPU compared looking for shader writes), the heap passes draws make in the title's recording threads; the largest is named the bottleneck
  • waiting for the card, sent-ahead settles, how long the submitting thread waited for the title to submit
  • processor use of the process
  • draws, dropped (top five reasons in a diagnostics build), indirect, mesh groups
  • pipelines being made, made, loaded from the library; slow driver compiles (count, total, slowest, the last one's shaders, from #687's slow compile log)
  • textures picked by index (uploaded, waiting, passed over) and their queue census
  • title buffer copies, depth twin copies, card copies sent up
  • process memory, video memory against budget, shared memory
  • a bar per frame for the last frames' times (green to 34 ms, yellow to 100 ms, red above, a grey line at 33 ms; the scale stops at four times the median, so one stall of seconds does not flatten the rest)

Each second's panel is also appended to overlay.log in the cache folder, shown or hidden (VICTORY_OVERLAY_LOG=<file> elsewhere, 0 for none). scripts/bench.ps1 puts it in the run's folder.

How

The figures are the ones the frame-rate line already takes each second (Meter::frame); card_clock_line, late_line and shadow::back_line now also return what they log. The text is drawn with GDI into a bitmap once a second. Each present writes the panel into an upload buffer of its own (one per present list, so a present still in the air keeps its buffer) and copies it onto the back buffer with CopyTextureRegion after the frame's CopyResource. No pipeline or shader. Saved frames (VICTORY_CAPTURE) read the source texture, so the panel is not in them. R8G8B8A8, B8G8R8A8, R10G10B10A2 and R16G16B16A16_FLOAT back buffers are handled. Other formats show no panel.

Checked

  • cargo build of victory-gpu with and without diagnostics; cargo test -p victory-gpu --lib 114 passed
  • one unit test: panel pixels in each back buffer format's layout
  • live, RTX 5060 Ti, 3840x2160 window, prologue: panel drawn from the first present (overlay drawn width=1428 height=620 format=28 in the log); overlay.log written each second
  • no frame-time change I could measure against runs without it (bench medians moved more between runs than the panel costs)
<!-- greyfinch-sync:fxceless/victory-fork:issue:6597876746 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/717). Originally posted by [abilliontokens](https://github.com/abilliontokens) on 2026-11-25T05:27:41Z. --- Stacked on #687 (itself stacked on #617): the first eight commits are those PRs'. This PR's own commits are the last four. It merges cleanly into the current main (310c6eb). ## What An on-screen panel of where the frame goes, in every build, shown from the start. F3 hides or shows it while the title's window has the focus; `VICTORY_OVERLAY=0` starts with it hidden. Once a second it shows: - the card, window size, uptime, frame number - fps, ms/frame, and the last 240 frames' median, 95th percentile, worst and the number over twice the median - preparing (copies, texture refreshes and what they waited for), GPU (card busy %, idle behind us), copy-back (and MB the CPU compared looking for shader writes), the heap passes draws make in the title's recording threads; the largest is named the bottleneck - waiting for the card, sent-ahead settles, how long the submitting thread waited for the title to submit - processor use of the process - draws, dropped (top five reasons in a diagnostics build), indirect, mesh groups - pipelines being made, made, loaded from the library; slow driver compiles (count, total, slowest, the last one's shaders, from #687's slow compile log) - textures picked by index (uploaded, waiting, passed over) and their queue census - title buffer copies, depth twin copies, card copies sent up - process memory, video memory against budget, shared memory - a bar per frame for the last frames' times (green to 34 ms, yellow to 100 ms, red above, a grey line at 33 ms; the scale stops at four times the median, so one stall of seconds does not flatten the rest) Each second's panel is also appended to `overlay.log` in the cache folder, shown or hidden (`VICTORY_OVERLAY_LOG=<file>` elsewhere, `0` for none). `scripts/bench.ps1` puts it in the run's folder. ## How The figures are the ones the frame-rate line already takes each second (`Meter::frame`); `card_clock_line`, `late_line` and `shadow::back_line` now also return what they log. The text is drawn with GDI into a bitmap once a second. Each present writes the panel into an upload buffer of its own (one per present list, so a present still in the air keeps its buffer) and copies it onto the back buffer with `CopyTextureRegion` after the frame's `CopyResource`. No pipeline or shader. Saved frames (`VICTORY_CAPTURE`) read the source texture, so the panel is not in them. R8G8B8A8, B8G8R8A8, R10G10B10A2 and R16G16B16A16_FLOAT back buffers are handled. Other formats show no panel. ## Checked - `cargo build` of victory-gpu with and without `diagnostics`; `cargo test -p victory-gpu --lib` 114 passed - one unit test: panel pixels in each back buffer format's layout - live, RTX 5060 Ti, 3840x2160 window, prologue: panel drawn from the first present (`overlay drawn width=1428 height=620 format=28` in the log); overlay.log written each second - no frame-time change I could measure against runs without it (bench medians moved more between runs than the panel costs)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/717:upstream-pr/717'
git switch 'upstream-pr/717'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/717'
git switch 'upstream-pr/717'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/717'
git switch 'upstream-pr/717'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/717'
git switch 'main'
git merge --squash 'upstream-pr/717'
git switch 'main'
git merge --ff-only 'upstream-pr/717'
git switch 'main'
git merge 'upstream-pr/717'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!717
No description provided.