[textures] How often a guarded texture nothing wrote is hashed, by a switch (VICTORY_TEXTURE_HASH_EVERY; 8 as before) #4530
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4530"
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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by AS-AI-DEV on 2026-11-30T22:00:23Z.
What it changes
A guarded texture that nothing wrote is still hashed every eighth frame, for what its guard cannot see (a write to its pages through another view). The 8 is a constant in
crates/victory-gpu/src/texture.rs. On my PC that hash re-reads about 36 MB of texture memory a frame on the submitting thread, in views where almost nothing changes.This makes the interval a switch:
VICTORY_TEXTURE_HASH_EVERY=<n>(1 to 1,024). Unset it is 8, so nothing changes for anyone who does not set it. A larger number hashes less a frame and finds such a change later (n frames at most).The idea is from Leslie-d-a/victory-nvidia-hwrt, which runs 64; the lines are mine (13 added, 2 removed, one file).
How it was tested
41adb55; the hashing code is the same one1251c3): a fixed walking route from a save in a house, 3 runs a side, all ended normally, frames of 6,000 draws and more.VICTORY_TEXTURE_TURN_SPREAD=1): the submitting thread 38.5 ms; fps 19.6 / 19.5 / 18.0 / 16.5 (+0.3 to +1.2 in each band); the longest frame of a second 64 against 71 ms; seconds with a frame over 100 ms 8 % both.TURN_SPREADalone gave nothing.e1251c3I have less: two standing starts a side (texture bytes read a frame 33 against 51 MB; the views differed between starts, so I do not quote fps), and a 35-minute play session at 64 in which I saw no wrong texture.cargo testpassed for the crates it touches: yes (victory-gpu).cargo clippy -p victory-gpu --all-targetswith and without--all-featuresreports nothing in the lines this adds (it stops at two lints that are on main already).A two-minute check on another PC
Nothing changes unless the switch is set, so the default path needs no test. To see what it does on your card:
fps, ms/frame (… preparing: copies … MB, textures … ms … MB; …)): thetextures … MBfigure andthe submitting thread: … ms.VICTORY_TEXTURE_HASH_EVERY=64andVICTORY_TEXTURE_TURN_SPREAD=1, stand in the same place, and compare the same two figures.On my PC the
texturesfigure falls to about a sixth and the submitting thread by about 5 ms. If the card is the limit on yours, the frame rate may not move; the thread time and the bytes still should.Checked for overlap
🤖 Generated with Claude Code
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by DoubleD17 on 2026-12-01T14:04:42Z.
A measurement of
VICTORY_TEXTURE_HASH_EVERY=64against8with this branch. It also measures #4493, which sets the same interval to 64 in code.Setup
5fabb46ewith this PR and #4396 merged (no conflict). #4396's switch was at0in both arms.--set VICTORY_TEXTURE_HASH_EVERY=8(as main) against=64.64: runs 3 and 4;8: runs 3 and 4). The texture figure below holds in all of them; the frame-rate figures are best read from runs 1 and 2.Texture refreshes, all threads, per frame (the "texture refreshes per frame, all threads" line, mean of each run's 150 s):
HASH_EVERYThat is about 8 ms a frame less across all threads (-45 %), in every run. It is more than the "about 3 ms" in #4493.
Submitting thread and frame rate
8, against 51.7 and 52.2 ms at64.Picture: 80 frames per run; we looked at every frame a frame-to-frame check flagged.
64, two frames were flagged. Both are the one-frame kind we also see on main and in the8runs here: the whole picture briefly from a slightly different camera position.Not tested: movement, textures written through another view, Series S, frame generation on, other cards.
AI Assisted
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:38:22Z.
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