Shaders: the tiled shadow programs translate exactly on 32-lane hosts #432
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/gamingwithhomie--larp!432
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-432"
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-12-06 00:48 UTC · original
brunofgmag:fix/tiled-shadows-exact→main· +862 −105 · 6 files · 1 commits · openWhat it fixes
On a 32-lane host (tested on an RTX 4080 under Proton), the sun and hair shadows come out in tile-sized blocks: dark squares on foliage and plants, and stepped white edges on clothes and heads. Leaving the 8
CS_ShadowRenderTiledCascades*programs out (LARP_LEAVE_OUT) removes the blocks along with the sun shadows, so the cause is in how these programs are translated.Nine tiled shadow programs were not in the exact form:
CascadesAlphaPPPC(d7db57731ada919b),MiscHairPPPC(b4b0427232707598) andMiscHairAlphaPPPC(abd7a22106898c66) fell to local waves, where each half-wave decides on its own. The cautious half of the stall guard kept 5 skips in each, so the exact stripped form was refused.CascadesAlphaCBPPPC,CascadesCBPPPC,CascadesPPPC,MiscAlphaPPPC,CascadesAlphaCBandCascadesCBusedRule::LanePairs. The blocks stayed with that rule. With the six moved toSTRIPPED_GONEthey went away.Changes
ir.rs: three fixes ported from VIctory commit 077f9da (the one that fixed Lucia's stepped shoulder in the prison scene):s_cbranch_execnzover a far jump (s_getpc_b64/s_add_u32/s_addc_u32/s_setpc_b64) to the end of the program is left out like ans_cbranch_execzone;without_skips(deep)follows scalar phis that only pass one value on;unspillpairs parked scalars per lane.by_hash.rs: a newLOOPS_OPENlist. Programs in it that are also inSTRIPPED_GONEdrop the cautious half of the stall guard, since their marks already end every loop for a wave with no lane left. It is keyed by hash, soCS_TV_Tiled(the water program the guard was written for) and everything else keep the guard. A first version that relaxed it for everySTRIPPED_GONEprogram hung the GPU (Xid 109) within minutes, withCS_RayPrePass_Alphain flight.whole.rs/stripped_gone.rs: the six lane-pair entries move toSTRIPPED_GONE.ir/tests.rs: 12 tests on synthetic programs for the three ported fixes and the guard list.Census
The whole of
shaders.rpf(26,084 programs) was translated withtranslate --listatLARP_HOST_MAX_WAVE=32, before and after. Nothing became refused. Exactly 12 of 25,694 DXIL files change: the nine shadow programs (now 93 to 265 group barriers each, where the approximate forms had 1) and threeGpuParticleEmitprograms, from theunspillpairing.In game
RTX 4080, Proton, Series X profile: the blocks on foliage, plants, clothes and heads are gone. 17 minutes of play with no device removal (the run ended by running out of system RAM with vkd3d-proton's breadcrumbs on, which keep a trace of every command list). The squares on water are a separate issue and are not touched here.
cargo test -p larp-shaderpasses.cargo clippy -p larp-shader --all-targets -- -D warningsreports nothing in the files this changes (it has 7 findings on main in other files).@brunofgmag on GitHub · 2026-12-06 01:09 UTC · original
This is the blocky sun shadow of #204 and #340. Both report the tile-shaped shadow blocks with
rt_directional_shadowsat its default, and a workaround that changes that setting (highin #204,lowin #340), which moves the sun shadow off these tiled programs. With this PR the default setting renders without the blocks.@vanya890 on GitHub · 2026-12-06 01:21 UTC · original
Possible direct cross-reference: issue #372 reports the same tile/checkerboard-shaped shadow flicker on an RTX 4080 Laptop (Windows 11, NVIDIA 621.24, Series S), with a second report from an RX 9070 XT on Linux. The symptom is reduced on v1.1.5 but remains visible around nearby hair. This PR's 32-lane tiled-shadow fix looks like a strong match, although the issue logs do not yet confirm the wave path. Could you check whether #372 is covered by the same programs and mention it in the PR if confirmed?
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.