Keep AMD's shader compiler (RX 9060 XT) from failing: size queries through a non-uniform handle, one clean-up pass for nine programs #62
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/DexNom--VIctory!62
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-62"
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?
@MrToucann on GitHub · 2026-11-26 01:50 UTC · original
MrToucann:amd-shader-fixes→main· +102 −2 · 5 files · 2 commits · openProblem
On an AMD Radeon RX 9060 XT (driver 32.0.32029.2010,
amdxc64.dll8.18.10.0514), creating the host pipelines of 13 translated programs makes the driver's shader compiler fail:0x8insideamdxc64.dll):victory warmdies with0xC0000005, or0xFFFFFFFFand prints nothing.The DXIL passes
dxil.dllvalidation, so this is a driver compiler bug. A user on an RX 9070 XT with the same driver hit the same crash (fxceless/victory-fork#1213).The programs were found by creating every program's pipeline in a process of its own: 2,684 compute programs, and 23,279 others each with a stand-in partner stage.
The change
bvh_skinning:CSComputeSkinningTreeAnimVelocity,GpuParticleUpdateCS_UpdateSkinnedAttachMeshTreeParticlesand bothrtdirectionalshadowsRT shadow tracesdescriptor_data) is asked through a heap handle of its own, marked non-uniform, rather than the uniform handle the buffer's loads use. This is the approach of fxceless/victory-fork#1213 (IxMxAMAR). The handle isn't counted innonuniform_handles, since its index is the same in every lane. Descriptors loaded per lane keep their handle as before.indirect_diffuse_lighting:CS_ScreenProbes_ActivateRaysFOLD) runs for it whateverVICTORY_SHADER_OPTsays (on this card the full clean-up has to stay off, since it trips the same compiler elsewhere).PS_*_PBR_MATERIAL_*GLINTS*pixel programsFACTS.The pass list is chosen by container digest, so other programs keep their passes as they are. Neither change alters what a program computes.
Everything lives in
emit/lower/amd.rs. Existing code changes by one line per hook, so it carries to forks:lower.rs:mod amd;, plus the size query's handle throughsize_view_handle.mod.rs:lower::amd::begin(c.digest);before lowering.shader.rs:| super::lower::amd::passes()in the clean-up's pass set.lib.rs: the new file intranslation_inputs!, so the shader cache keys on it.How the size-read crash was narrowed
Reduced with DXC built from source (
dxa/dxopt) to 46 instructions:getDimensions;Each of the three is needed. Passing the size through
waveReadLaneFirst,waveReadLaneAt, a doublebfrev, or a separate handle on the same index that stays uniform still crashes. A non-uniform handle (#1213's finding) builds, and so does groupshared memory across a group barrier (this PR's first version, now replaced).Testing (RX 9060 XT)
cargo test -p victory-shader: 240 passed.translate --validate --pipelinesvalidates and creates the pipeline, withVICTORY_SHADER_OPT=0and with it unset.Side finding, not addressed here: making all compute pipelines in parallel in one process removed the device partway on this card (
0x887A0005), whilevictory warm --jobs 1made all 2,734.🤖 Generated with Claude Code
https://claude.ai/code/session_01A752X7rKCzD2ViPbSWcyut
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.