Repository navigation
GPU: hash textures that changed lately at every check (fixes startup flicker) - #63
arminkhaleghirod wants to merge 1 commit into
Conversation
The texture guard skips a texture in view memory unless it saw a write, hashing it only every eighth frame. It cannot see writes through another view, so a ring of video frames filled that way was shown out of order: the startup animation flickered back and forth. A texture whose hash changed is now hashed at every check for 30 frames.
|
Checked this on a Linux host (CachyOS, RX 7900 XT/RDNA3, Mesa 26.3.1 RADV) at
The change itself reads right to me: the guard misses writes made through another view, and a frame-ring texture is exactly that shape. Two things I would want in the PR before merge:
If it helps, this rig can run the before/after on the loading phase (where the texture lane is already 146–907 ms/frame) and quote |
|
Independent test run on commit
AI use: Antigravity (Gemini 4 Neon) ran clippy/tests locally and wrote this report. |
|
Closing in favour of #58: same fix, opened first, and it also covers new textures and has an off switch. Tested it, it scores clean (numbers on #58). Thanks @rostaddotcc for the review. The cost point applies there too. |
|
Correcting my earlier note: the
The one failure is the same on both and is not yours: |
|
Confirmed on AMD: RX 9060 XT 16 GB (RDNA4), Adrenalin driver 32.0.32029.2010, i7-9700K, Windows 11 Pro 26300, diag build, Series X profile, default switches plus
Judged by eye over several runs, no frame captures. I also tried an extra change on top (making the host copy at once when a live slot gets a view of a texture that has no copy yet, for AI-assisted (Claude Code, Claude Opus 5.5): bisected with the switches and wrote this; runs on my own machine. |
|
Tested on an RTX 5080 (merged with #80, #71, #81, #77 and #38 on Setup: NVIDIA GeForce RTX 5080 16 GB, driver 621.14, i9-13900KF, Windows 11 26200, release build, Series X profile. AI use: Claude Code, Claude Opus 5.5 merged, built, ran the tests and the game, and wrote this comment. The visual check is the user's. |
…uploads Credit NuraadGit (fxceless#159), ryotdev (unlocked reads), adritoyalser (fxceless#80), arminkhaleghirod (fxceless#39/fxceless#63), and brunofgmag (geometry A/B). Preserve inline placement for correctness testing. Native validation pending.
Fixes #39.
The texture guard (
VICTORY_TEXTURE_GUARD, on by default) skips a texture in view memory unless it saw a write, and hashes it only every eighth frame. It can't see writes made through another view, which is how the startup animation's frames get filled. So the three textures it cycles through were each refreshed only now and then, and the animation jumped back and forth between old frames.Now a texture whose hash changed is hashed at every check for the next 30 frames. Animated textures stay current, and static ones keep the guard's savings.
Frames 550 to 1000, on an RTX 4080 with the Series X profile. A jump back is a frame where n and n+2 match but n+1 doesn't.
VICTORY_TEXTURE_GUARD=0Also confirmed by eye: no flicker.
cargo test -p victory-gpupasses, and clippy is clean.