Shader cache key misses four translator switches (WATER_TILE_SLOTS, WAVE_LOOP_SKIPS, MEMORY_NEAR, LDS_START): with a warm cache, =0 is served the default translations #1504
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 fxceless/victory-fork. Originally posted by MrEjecutor on 2026-11-28T03:25:02Z.
Read in the code at
9e90746; not reproduced in a run.crates/victory-gpu/src/shader_cache.rs,build(): the cache's key is made of the translator's fingerprint, the loop limit,group_sync(), a list of switches by name,VICTORY_EARLY_DEPTH,shader_opt()andhost_settings(). Four switches that the translator reads are in none of those:=0givesVICTORY_WATER_TILE_SLOTSemit/water_tile_slots.rson(), throughhost_formintranslate_plainVICTORY_WAVE_LOOP_SKIPSemit/mod.rs, where the wave-wide forms are triedVICTORY_MEMORY_NEARemit/mod.rsmemory_near()VICTORY_LDS_STARTemit/lower.rslds_start_on()All four are on unless set to 0, and 0 is there to get the code of before (the README names the first and the third that way). With none of them in the key, a run with one of them at 0 on a cache that a default run filled is served the default translations, and the other way round: comparing the switch on and off then compares a translation with itself. It is the case the comment above the list describes for
VICTORY_WAVE_WIDE=0. The doc comment ofmemory_near()already says "Part of the translation: the shader cache keys on it."A change that would close it:
Every key changes once with it, as with any change to that file (
build.rstakesshader_cache.rsinto the translator's fingerprint). With it,cargo check -p victory-gpu --all-targets --lockedpasses here.cargo clippy -p victory-gpu --all-targets --locked -- -D warningsdoes not get as far asvictory-gpuon9e90746: it stops invictory-shaderatemit/water_tile_slots.rs:87(manual_is_multiple_of), a line this change does not touch.Not tested: any of this in the game: I have not run this fork's current
main, so I have not seen a cached translation served under the wrong switch, only read that nothing tells them apart. I looked only at the switchescrates/victory-shader/srcreads from the environment;VICTORY_RDNA_FLOAT,VICTORY_GROUP_SYNC,VICTORY_SHADER_OPTandVICTORY_SHADER_LOOP_LIMITreach the key by its other parts, and the rest looked like diagnostics or test inputs by their names, which I did not read one by one.AI-assisted (Claude Code): the reading of the code and this text. No game files attached.