Shaders: the water's tiled light is folded before the wave-wide branches even past the 126-VGPR cap (VICTORY_WAVE_FOLDED_FIRST), as its wave-wide form leaves dark tiles #4497
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!4497
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4496"
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?
@brunofgmag on GitHub · 2026-11-30 21:20 UTC · original
brunofgmag:pr/water-fold-first→main· +1014 −863 · 33 files · 14 commits · closed without mergingWhat it changes
The water's tiled light programs are folded before the wave-wide branches again, even past the 126-VGPR cap of #2261. They are
water_shading:CS_TransmissionVolumetrics_Tiled(5dc3b25986622949),_Tiled_LocalLights(6f225b641c5b0708) and the submerged ones.They are named in a short list,
FOLDED_FIRST_BY_DEFAULT(TransmissionVolumetrics), next toUNFOLDED_BY_DEFAULT.VICTORY_WAVE_FOLDED_FIRST=<text>,...replaces the list, and an empty value turns it off. The switch is in the shader cache's key. Every other program goes through #2261's order as before.Why
#2261 (qlfu) tries the wave32 forms it takes as exact before folding. It folds early only a program that fits in 126 console VGPRs.
_Tiled_LocalLightsholds 156, so it now skips the fold and takes the wave-wide branches. For this program that form is the one that leaves whole tiles of open water dark around boats, along shores and under bridges (#739). That is why #1926 (dheerajc8073) leaves the water light out on 32-lane cards. Folded, the program has no dark tiles.What each build makes of the two programs, translated one at a time with
VICTORY_WAVE_WHY=1,VICTORY_HOST_WAVE=32andVICTORY_WAVE_FOLDED=1(victory translate shaders.rpf --warm <hash> --jobs 1):maine1251c315dc3b25986622949(101 VGPRs)6f225b641c5b0708(156 VGPRs)How it was tested
emit::tests::the_waters_tiled_light_is_folded_first. #2261'semit_strict_prefers_exact_wave32_over_fold_and_defers_over_255_vgpr_foldand the 25foldedtests pass.cargo clippy --workspace --all-targets -- -D warningsstops on three warnings that are onmainalready, none in this change:crates/victory-shader/src/emit/lower.rs:114(loop_capsnever read),crates/victory-gpu/src/shadow.rs:7197(rangednever used) andcrates/victory-gpu/src/host.rs:5092(manualis_multiple_of).Related
VICTORY_WAVE_FOLDED_SKIPand reads their unfolded form as exact. For_Tiled_LocalLightsthe wave-wide form is the one with the dark tiles. With both merged, the skip list wins and this list does nothing for those programs.VICTORY_WATER_LIGHT=1(WATER LIGHT in F1) runs the folded form. The default from #1926 is unchanged.@brunofgmag on GitHub · 2026-11-30 22:38 UTC · original
Checked in gameplay on top of this change (with #2261 merged), RTX 4080, Series X at 4K, DLSS performance, frame generation 2x:
VICTORY_WAVE_WHY=1, both5dc3b25986622949and6f225b641c5b0708come out folded._Tiled_LocalLightsin the wave-wide form. That is about 2 fps for the spill of the 156-VGPR program.@VibeCodeGuy on GitHub · 2026-12-01 00:25 UTC · original
Offline corpus check (every shader container in a v1.0.2.1 dump: 25,699 unique programs),
maine1251c31againstmain+ this PR at2985b8ce, both withVICTORY_WAVE_FOLDED=1.The 3 changed programs
926c46bab3b86bd6Cswater_shading:CS_TransmissionVolumetricsSubmerged6f225b641c5b0708Cswater_shading:CS_TransmissionVolumetrics_Tiled_LocalLightsa10179ab7eda0dc3Cswater_shading:CS_TransmissionVolumetrics_VolumePortalsOnlyHow:
victory translate <dump> --validate --listbuilt for each side (release, cross-built with cargo-xwin, run under Wine),VICTORY_HOST_WAVE=32, plus the four shader-cache-key settingsplaystarts with (VICTORY_EARLY_DEPTH=1,VICTORY_NAN_SCRUB=1,VICTORY_BVH_MISS=1,VICTORY_SAMPLED_MARKS=1). Validator:dxil.dllfrom DXC v1.9.2609. "Changed" compares translate'semittedhash of each module and its bindings. There was no GPU on this side, so no host pipelines were made and nothing was run on a card. Onmainthe same run has 72 failures: 71 mesh programs over the 32 KiB output limit (the known shortcut inmesh_prologue) andCS_TraceShadowRays_FullAdaptive(#2993).These 3 programs are the ones the description names:
_Tiled_LocalLights(6f225b641c5b0708) and the submerged one, plus_VolumePortalsOnly, which also matchesTransmissionVolumetrics._Tiled(5dc3b25986622949) doesn't change, as the table says:mainalready folds it.One thing to know before merging: without
VICTORY_WAVE_FOLDED=1the same comparison changes 0 programs, because the new path is behindfold::enabled(). Neitherplay's defaults nor any F1 item (WATER LIGHT sets onlyVICTORY_WATER_LIGHT) setsVICTORY_WAVE_FOLDED=1. So players who turn WATER LIGHT on still get the wave-wide form unless they also set that variable by hand. If the aim is to make WATER LIGHT usable on 32-lane cards, the list may need to apply without the global fold switch.@rvrvrvr221 on GitHub · 2026-12-01 08:35 UTC · original
In-game test on an RTX 4090: v2026.11.30.03 against this PR at
2985b8cePC: Core i9-13900K, RTX 4090 24 GB (driver 621.40), 32 GB DDR5-6400, Windows 11 Pro (build 26300).
Every run: the launcher's defaults with
-NoMenu(Series X, 2560x1440, DLSS Quality, frame generation off, ray tracing off), plusVICTORY_WATER_LIGHT=1. Same save in the first boat mission after the prologue: the buoys and mission marker, the bridge, the shore, one dive.VICTORY_WAVE_FOLDED_Tiled_LocalLightsform1111The forms were checked offline for each build and setting, each on an empty cache:
victory translate shaders.rpf --warm <hashes> --jobs 1withVICTORY_HOST_WAVE=32 VICTORY_WAVE_WHY=1._Tiled_LocalLightscomes out wave-wide in A, B and C and folded in D, as in the description's table.What this shows, with only two runs a side and judged by eye:
_Tiled_LocalLights(A, C1, C2): not at the buoys and marker, along the shore, or under water.VICTORY_WAVE_FOLDED=1nothing changes (B is A, offline and in game).a host command list did not close (0x80070057)(one on each build), before either water program was first bound. None in the 2 starts without folding. That looks like #4576, not this PR.Seen in every build, so not from this PR: foliage flicker, a bridge flickering white, some distant trees untextured, afterimages under water.
Not tested: ray tracing on, frame generation, Series S, a diagnostics build with
VICTORY_D3D12_DEBUG=1.@trustno1-coder on GitHub · 2026-12-01 18:39 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