Shaders: hoist constant LDS accumulator initialisations behind an entry barrier #35
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!35
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-35"
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?
@wike1701 on GitHub · 2026-11-27 11:58 UTC · original
wike1701:feat/lds-init-hoist→main· +228 −0 · 2 files · 1 commits · openPort of \xceless/victory-fork\ commit \918163\ (GPL-3.0).
Problem
Tile compute shaders (including the water tile min/max shaders) initialize LDS accumulator dwords from thread 0 after per-pixel early returns, followed by group-wide \ds_min_u32\ / \ds_max_u32\ atomics. When thread 0 takes an early return, the remaining threads accumulate against uninitialized LDS memory, producing flickering dark patches in water tiles.
Fix
Verification
@jptorres96 on GitHub · 2026-11-27 16:15 UTC · original
Independent run on RTX 4080 SUPER 16 GB (Ada, 32-lane waves), driver 621.01, Ryzen 5 5600X, Windows build 26300, toolchain 1.98.1, DXIL validator from DXC 1.9.2609.5,
VICTORY_REQUIRE_HW_GPU=1. Head759f05c(on its own base959dcaf; GitHub reports a conflict with currentmain).accumulator_inits_are_hoisted_to_the_start: passedcargo clippy -p victory-shader --all-targets -- -D warnings: cleancargo test -p victory-shader --lib -- --test-threads=1: 288 passed, 0 failed, 4 ignoredNo game dump here, so I could not look at the water tiles themselves.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.