fix(shader): the water light's tile lists take a slot a lane #221
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/221"
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 mutlusinan on 2026-11-27T19:53:36Z.
Problem
On a host of 32-lane waves,
water_shading:CS_TransmissionVolumetrics_GenerateTiles(the title, build 1.0.2.1) runs as two host waves per console wave, and the two tile appends in it assume a 64-lane wave: the first lane adds the whole wave's count and every lane's slot is its rank on top of what the counter held. The second half's rank needs the first half's lane mask; without it the second wave's tiles overwrite slots of the first, those tiles get no light, and the sea shows dark blocks around boats, piers and lamp posts (blocks of 16x16 pixels). This is why this fork currently leaves the water light's two programs out by default (VICTORY_WATER_LIGHT, off).Fix
emit/water_tile_slots.rs: before translation, the known program is rewritten so every lane takes its own list slot — one atomic add of 1 per lane, and the lane's slot is what the counter held. Slots are still each given once and the counters end the same; only the order within a list differs, which nothing reads. No lane mask, first lane or exchange between the halves is left in the two appends.VICTORY_WATER_TILE_SLOTS=0restores the old form.emit::translateand invictory translate(which drivesemititself), so the offline path sees the same form.Verification
cargo check --workspace --target x86_64-pc-windows-msvc --locked— clean.cargo run -p xtask -- policy— 286 files ok.VICTORY_WATER_LIGHT=1, watching for the dark blocks around boats and piers.Ported from fxceless/victory-fork
cd93552, itself after xss3009's "Fix transmission tile allocation on wave32 hosts"; written again for this tree (GPL-3.0-or-later, GPL-compatible).Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mutlusinan on 2026-11-27T20:21:17Z.
Risk assessment (porting review)
pipeline::make::left_outleaves the water light's two programs out unlessVICTORY_WATER_LIGHT=1(crates/victory-gpu/src/pipeline/make.rs:88), so this program is never translated andhost_formnever sees it. The offline translator additionally needsVICTORY_HOST_MAX_WAVE=32:host_max_wave()defaults to 0 andhost_formrequires 32.→ This PR is a no-op until that leave-out is removed; that should be its own change, after the fix is proven in play.
translation_fingerprintcovers the translator source hash, everyVICTORY_*switch the source names (the build script scans for them, soVICTORY_WATER_TILE_SLOTSis included) and the host facts includinghost_max_wave— toggling either side does not reuse a stale translation.mainate69e39c.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by cloph-dsp on 2026-11-28T02:35:15Z.
Independent local verification (Windows, Rust 1.100.0/MSVC, no game data):
a37e53267e5b096e452f9f53031bff91d8e9a857, merge base0cef07e9d766df48f0e95f13ce3bbbe2290fe9d3.cargo test --locked -p victory-shader --lib -- emit::water_tile_slots::tests::an_append_becomes_one_add_a_lane_and_keeps_its_length --exact --test-threads=1 --quietcargo test --locked -p victory-shader --lib -- emit::water_tile_slots::tests::another_program_is_left_as_it_is --exact --test-threads=1 --quietgit grep -Ffor these test names on the base returned no hits (tests are new on this PR);git diff --check 0cef07e9 HEADclean (3 files, +185/-2).CARGO_TARGET_DIR(never shared) withCARGO_BUILD_JOBS=2.AI-assisted (Hy4 flash).
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dsh38 on 2026-11-28T03:58:54Z.
Independent in-game check on main
8fc2254(v2026.11.27.10), Windows 11 25H2 build 26200.9974, RTX 4080 SUPER 16 GB, driver 617.14. I used Series X, DLSS Performance (1280×720 to 2560×1440), a 1920×1080 window and a local 4× FG configuration. Each run started with a copy of the same save and an empty engine cache.With the water lighting enabled, the boat mission showed a dark, screen-aligned rectangle at the waterline of a passing yacht. I instrumented the successful rewrite and confirmed that this PR’s per-lane allocation actually ran for
1aa247ed3653b616. The rectangle was still visible in that run.I then removed the per-lane rewrite and tried the water subset of Vice-Tay #208 at
fe7c6e5. The generator and both tiled lighting consumers translated with paired Wave64 and created D3D12 pipelines. On the same route the water stayed lit, and the player confirmed that the rectangles under boats and the marked pickup were gone. The submerged shader was outside this surface test. This comparison changes the three surface shaders together, so it does not establish which individual shader is sufficient.Successful run, play log excerpts:
No crash log was produced during these rendering comparisons. AI-assisted testing on physical hardware.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by xss3009 on 2026-11-28T04:07:33Z.
I tested PR head
a37e53267e5b096e452f9f53031bff91d8e9a857on a physical RTX 5070 Ti (16 GB, driver 621.24, Windows 11 build 22631). This was the upstream diagnostics build of the unmodified PR head. I used a private copy of the first-chapter boat checkpoint, Series X, a 1920×1080 scene with 2560×1440 output, and DLSS, frame generation and the BVH builder off.Both
VICTORY_WATER_LIGHT=1andVICTORY_WATER_TILE_SLOTS=1were set. The runtime logged 32-lane waves and successfully created the D3D12 compute pipelines for1aa247ed3653b616,5dc3b25986622949and6f225b641c5b0708.Observed during the first boat ride: the previous large dark rectangles were not seen in this stretch. Small black blocks still flickered around another vessel's waterline on the bridge approach. The still frame locates the vessel, and the flicker was observed during live play. This run does not include a matched switch-off comparison or a per-pass capture of the small blocks, so it does not identify which pass causes the remaining artifact. The location is similar to the residual described in the RTX 4080 SUPER report above.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by xss3009 on 2026-11-28T04:29:18Z.
Follow-up on the RTX 5070 Ti waterline reproduction.
I kept
VICTORY_WATER_LIGHT=1and the PR's per-lane allocator enabled in both runs. On the unmodified PR shader path (with diagnostics for capture), the player captured several rectangular dark patches at the shore/water boundary before the first bridge and observed intermittent smaller patches on the water. In a local build based on this PR, I ported the paired Wave64 lowering from Vice-Tay #208 and selected only the two surface lighting consumers,5dc3b25986622949and6f225b641c5b0708.GenerateTiles(1aa247ed3653b616) still used the PR's per-lane allocator. Its emitted DXIL hash matched the PR baseline in the offline control.Both paired consumer shaders validated with Microsoft's DXIL validator, and the run log confirmed both used the paired route and created D3D12 compute pipelines. Both runs used the same first-boat checkpoint, 1080p scene with 1440p output, and no DLSS, frame generation or BVH builder. The player saw the bridge-approach view clean up. Three bursts of 24 presented frames from the local build at the rear-camera bridge approach supported the visual result. We matched the bridge direction and camera framing approximately, without matching a passing yacht's exact position or the exact mission tick.
This narrows that reproduction to the two consumer passes as a group. I have not isolated which consumer is necessary in game. The clean result is from the local paired-consumer change on top of
a37e532. Please consider the two consumer paths alongside the allocator before using the result to enable experimental water lighting by default.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mutlusinan on 2026-11-28T12:01:29Z.
Rebased onto current
main; the earlier "inert" note is supersededRebased onto
63b902f(force-with-lease) and re-verified:cargo check --workspace --target x86_64-pc-windows-msvc --lockedis clean.Correction to the risk note above: since
64d4931("Water light on…") the water light's two programs are translated by default (VICTORY_WATER_LIGHT=0turns them off), sohost_formis no longer inert — this rewrite would run in ordinary play on a 32-lane host. The rest of the note still holds: the rewrite is gated on the container digest, the code length and the FNV-1a of the whole program, so a different build makes it a no-op, and a wrong offset would affect that one program only. An in-game check of the water now matters before merging.Also note
mainfixed a different cause of the same symptom in the meantime (VICTORY_LOOPS_WAVE,CS_TransmissionVolumetrics_Tiledloops inir.rs); this change addresses theGenerateTileslist slots and the two are independent.GitHub reports the CI run as
action_required(a fork contributor's run waits for maintainer approval), so nothing has been executed yet.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-28T19:23:56Z.
Thanks for this. I'm closing it without merging: main already rewrites the same water light program on 32-lane hosts (#45's water_tile_append), and the two conflict. If yours fixes something #45 doesn't, please rebase on the current main and open a new pull request with a comparison.
Pull request closed