FPS line: its texture is the strip it shows, not the whole F1 box #4284
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4284
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4283"
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?
@Kam471 on GitHub · 2026-11-30 18:10 UTC · original
Kam471:fps-line-strip→main· +851 −852 · 32 files · 11 commits · closed without mergingWhat it changes
With F1 closed,
VICTORY_FPS_LINE(on by default,crates/victory-gpu/src/host/menu.rs:249) shows a strip at (0,0) of(len * CELL.0 + 2 * RIM) x (CELL.1 + 2 * RIM)times the scale — about 304x34 at 1080p. It is drawn from the menu's own buffers, which are the whole box:size(:843) is(60 * 6 + 2 * 4) * scaleby(29 * 9 + 2 * 4) * scale, 736x538 at 1080p.Buffers::new(:958) therefore makes four upload buffers and a card buffer ofpitch * height= 2944 x 538 = 1,583,872 bytes each,painted(:921) fills all of it,Buffers::writecopies all of it into an upload buffer, andMenu::draw(:2001) copies all of it to the card withCopyResourcewhenever the text changes — once a second, sincefps_lineformats{:.1}.CopyTextureRegionthen takes thew x hcorner out of that card. A 34-row corner is painted and copied to the card from a 538-row picture, 1,583,872 bytes a second at 1080p.Buffersnow carries the size of the picture it holds, and the menu keeps two: the box (index 0) and the frame-rate line's strip (index 1), sized as above with the same rim the box uses. Each is made once and kept, so closing and opening F1 remakes neither — a remake leaks the old set, as it already did for a resize, because a list may still copy from its card. The strip is grown and not shrunk when a rate gains a digit, so the numbers changing does not make new buffers; a longer line than any seen so far remakes it once.What is copied onto the back buffer is the same region of the same pixels:
the_frame_rate_lines_strip_is_the_boxes_first_rowsasserts the strip is the box's first rows byte for byte. The F1 box's own buffer is untouched, and the strip's footprint and copy region come from its own size instead ofsize(scale).The line's upload falls from 1,583,872 to 43,520 bytes a second for a 24-character line (304x34, pitch 1280).
How it was tested
size,CELL = (6, 9),RIM = 4and the 256-byte pitch rounding inBuffers::new). Not measured on a card.cargo testpassed for the crates it touches: yes forvictory-gpu, with two failures that fail on84bd61e2as well —list::thin::tests::bindings_record_no_workandshader_cache::tests::every_switch_of_the_translator_is_in_the_key; the newthe_frame_rate_lines_strip_is_the_boxes_first_rowspasses.cargo check -p victory-gpu --lockedpasses.checkjob isaction_required(a pull request from a fork waits for approval).cargo clippy -p victory-gpu --all-targets --lockedreports the same two findings as on84bd61e2—Shadow::rangednever used andmanual_is_multiple_ofathost.rs:5092, neither in the files this changes (main's clippy gate is red; #4166 fixes it).Checked for overlap
fps_lineand its tests); it changes the text, not the buffers, and a longer line still fits (the strip grows). #3982 proposes a new look for the overlays from a fork and is not a pull request here; it keeps the same data.AI use
Kam471, with OpenCode, model
DeepSeek V4.1 Flash 1017.With F1 closed, the frame-rate line is drawn from the menu's own buffers: the box's 736x538 at 1080p (`host/menu.rs` `size`, `CELL` and `RIM`), painted in full by `painted` and copied to the card with `CopyResource` every time the rate changes — once a second at `fps_line`'s `{:.1}` — to show the `{w}x{17}` strip at (0,0) that `CopyTextureRegion` takes from its top left. 1,583,872 bytes a second of painting and card copy (pitch 2944 x 538 rows) for a 304x34 corner. `Buffers` now carries the size of the picture it holds, and the menu keeps two: the box, and the line's strip (`CELL.1 + 2 * RIM` rows, as wide as the line and its rim). Each is made once and kept, so opening and closing F1 remakes neither, and the strip's is grown rather than remade when the rate grows a digit. The box's own buffer is untouched, and what is copied onto the back buffer is the same region of the same pixels: the strip is the box's first rows byte for byte (`the_frame_rate_lines_strip_is_the_boxes_first_rows`). The line's upload falls from 1,583,872 to 43,520 bytes a second for a 24-character line (1280 x 34). Checked: `cargo check -p victory-gpu --locked`; `cargo test -p victory-gpu --locked --lib` (1132 passed, and `list::thin::tests::bindings_record_no_work` and `shader_cache::tests::every_switch_of_the_translator_is_in_the_key` fail on84bd61e2too).@trustno1-coder on GitHub · 2026-12-01 18:44 UTC · original
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed