fix(gpu): time the look-again cap of away textures by the frame #496
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem!496
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-496"
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?
@arutkowski00 on GitHub · 2026-12-04 18:32 UTC · original
arutkowski00:pr/lookagain-cap→main· +37 −9 · 1 files · 1 commits · openProblem
A slot whose texture memory is not mapped yet is looked at again after 1, 2, 4, ... frames, up to the number of frames in about four seconds. Those frames were counted from the time between texture passes, of which there are several a frame, so the cap sat at its 256-frame ceiling nearly always: 10-18 s at 14-25 frames a second. A texture the title streamed in was noticed 0.9 s late on average and up to 16 s (
texture_late"away_to_upload"), and was drawn blurry or missing meanwhile.Change
The cap now comes from the title's frame time, smoothed over a few frames, so it is about four seconds as intended (100 frames at 25 fps). One file,
draw.rs.Switch
None. This corrects the unit the cap was computed in; it does not add behaviour. The only visible difference is how late a streamed-in texture is noticed. I did not compare output with a switch off, because there is no switch. If maintainers want one, say so and I will add it.
Queue
Independent of the open PRs I found touching
draw.rsand the texture look: a test merge with #355, #313 and #481 is clean. I did not compare the intent of the others in the list.How it was checked
cargo xtask policy: ok.texture_latecounters in one play session on an RX 7900 XTX. I have not re-measured them after the change as a separate run, so the improvement in how late a texture is noticed is expected from the arithmetic of the cap and is not yet measured.Not tested
Cost
No memory cost. The frame time is smoothed with a few arithmetic operations once a frame. No new switch, nothing on by default that was not already.
draw: time the look-again cap of away textures by the frameto fix(gpu): time the look-again cap of away textures by the frame@Kal0s-design on GitHub · 2026-12-04 19:08 UTC · original
Checked
597e595on native Windows (one NVIDIA desktop card, didn't run the game).cargo test -p victory-gpu --libgives the same result as main apart from the usual native failures (indirect host_list x2, the two pipeline library loads, one flaky watch test that only failed on the PR run). Clippy is clean with and withoutdiagnostics, with the same warning count as main.The change looks right to me.
frameis the title's frame counter from frame.rs, so the first pass of each frame sets the time, and the CAS keeps the other passes of that frame out. Division by zero can't happen (the 0 case falls back to 16 ms), and the result is still clamped to 16..256.PASSEDwas local, so nothing else used the old value.I copied
frame_msinto a scratch program with a fake clock and fed it frame times with 4 passes a frame. On main, steady 40 ms gives 256 almost every pass (102 on the first pass when the passes are bunched). The PR gives 100. 16 ms gives 250, and 5 ms gives 256. Alternating 16/66 settles around 95-111. A single 2 s hitch in 40 ms frames drops the cap to 16, and it takes about 15 frames to climb back to 88. Six frames at 0.5 fps keep it at 16 for about a dozen frames after the rate recovers. Both cases only mean extra looks for a short while, so that seems fine.Two small things, neither blocking
texture_late/the timeline when you re-measure.heap_texturesstill says the wait is "at most about a second". That was already out of date before this PR, but now is a good time to make it say about four seconds.AI-assisted: yes
@turboheadcrab on GitHub · 2026-12-04 21:20 UTC · original
Measured
597e595against its base2382b4c, two runs each:texture_lategoes up, the blinks from #463 don't change.Setup: RX 9070 XT 16 GB, Linux, RADV, diagnostics profile. Series X, FSR 4 Quality (960p → 1440p), RT on, no frame generation. Standing on an idle save with the cinematic camera running, popwatch from 120 to 600 s. That runs at about 24 fps, so this is the "cap 100 instead of 256" case from the review. The two builds were run alternately.
away_to_uploadat ~600 s: nSo at this frame rate, looking at away slots more often doesn't seem to bring them in sooner here. If anything they are counted late more often and for longer. I didn't separate whether the count rises because the lookups themselves take longer or because more slots are counted, and I haven't run it rebased on top of #503.
AI-assisted: yes
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.