GPU: a debug overlay, Alt+Z, drawn into the presented frame #2171
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2171
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2171"
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?
@0xkn0wh3r3 on GitHub · 2026-11-25 06:53 UTC · original
0xkn0wh3r3:tools/overlay→main· +2219 −5 · 6 files · 4 commits · draftA small debug overlay drawn into each presented frame, toggled with Alt+Z.
The panel at 1080 lines, as the ignored
previewtest renders it from sample data (compute left out, A and RB held). It has not been captured from a running title. At 1440 lines: overlay-1440.png.What it shows
Four sections, each with a header; labels on the left, values right-aligned with their units.
Metersecond: draws per frame, time preparing submissions, and time waiting for the GPU;GetProcessTimesagainst the processor count);QueryVideoMemoryInfoon the device's adapter);gameinput(the keyboard's stand-in pad when none is connected): a box per stick with its position, bars for the triggers, and the buttons lit while held.While the panel shows, the title reads neutral pads and no keys.
Switches
VICTORY_OVERLAY=1shows it from the start;VICTORY_OVERLAY=0turns it off.How it is drawn
On the CPU, into upload memory in the back buffer's format (RGBA8, BGRA8, RGB10A2 or RGBA16F, the four the presenter makes), then copied into the back buffer's corner after the frame, before the present, with one
CopyTextureRegion.Relation to #130
#130 is the full opt-in profiler (CSV, Perfetto trace, and a panel behind F3). This one is smaller and independent: a live panel with controller input and work toggles, and no new crate. If #130 lands first, this panel could take its numbers instead.
Changes
crates/victory-gpu/src/overlay.rs(new): the panel, its drawing, the keys, and the submission timer;host.rs: the presenter records the panel's copy,Meterhands over its second, andHost::executesubmits through the timer while the panel shows;list.rs: the four toggle gates at the draw, dispatch, mesh and indirect entry points;victory-hlegameinput.rs: publishes the pad, notes the title's input reads, and gives the title neutral input while the panel shows;Win32_UI_Input_KeyboardAndMousefeature forvictory-gpu.Testing
overlay::tests(9):cargo test --workspace --exclude victory-shader: 571 passed. The only failures are the 2 known NVIDIA heap-limit tests (#1835), which fail the same way onmain.cargo clippy --workspace --all-targets, with and without--features diagnostics: clean.Rebased onto
f3578e3Overlay::recordnow takes the back buffer's state and returns the state it leaves it in, so the composited path moves the back buffer to the copy destination only when the panel is copied.State::poll: the overlay's pad and input capture now run insideState::poll, after both, so the panel shows the pad the title actually reads.cargo test -p victory-gpu --lib: all pass but the two known NVIDIA heap-cap tests;overlay::testsandgameinputtests pass.host::present_plane_tests::compositor_failure_presents_primary_in_the_same_frame(--features diagnostics) exits abnormally here onmainas well. Clippy clean forvictory-gpuandvictory-hle, with and without--features diagnostics.@0xkn0wh3r3 on GitHub · 2026-11-25 07:23 UTC · original
Moving this back to draft. There is a lot more I want to add and I found some bugs with how it interacts with in-game controls.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.