Shaders: leave the reuse pass out on AMD, whose compiler crashes on it #61
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/61"
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 Zettrox/ztrx. Originally posted by PikPakPik on 2026-11-25T07:08:13Z.
Fixes the AMD crash a minute into the prologue: the title dies with
0xc0000005insideamdxc64.dll, always atamdxc64.dll+0x861b9f, underCreateComputePipelineState.Why: AMD's shader compiler (RX 9060 XT, driver 32.0.32029.2010) crashes compiling
CS_RaytracingResolve(501f0865fdf45dfd), the first program of the ray-tracing resolve the prologue binds. The DXIL is valid (dxil.dll's validator passes it), so this is the driver. Retranslating that one program with each clean-up pass left out in turn (VICTORY_TRANSLATE_ONLY=501f0865fdf45dfd victory translate --pipelines), only leaving out pass 4, one instruction for one value (VICTORY_SHADER_OPT=59), compiles; leaving out any other pass still crashes. Capping host waves at 32 does not help.What:
emit::set_host_vendor(vendor)leaves the reuse pass out on AMD (0x1002) unlessVICTORY_SHADER_OPTnames it; the driver merges repeated values itself. Both the runtime device (victory-gpu) and the translator's test host (translate --pipelines) call it, and the shader cache already keys onshader_opt(), so translations cached with the pass are not served.Verification:
cargo test -p victory-shader -p victory-gpupasses (110 and 210), clippy is clean. On the RX 9060 XT,translate --pipelines --validateover that program now reports "pipeline created", and the title ran the prologue for 6 minutes without a crash at about 2 fps, where it crashed after about a minute before. One pipeline is still refused there (mesh f5e50eb2108c425b), the integer-target blending that #36 fixes.Imported from Zettrox/ztrx. Originally posted by iNaxxs on 2026-11-25T09:51:02Z.
Heads-up on an overlap: my #27 adds the same
host adapterlog at the sameplace, with the same GetDesc1 / nul-trim / from_utf16_lossy shape, so the two
will conflict in
crates/victory-gpu/src/host.rs.#27 also changes which adapter the device is made on: on a laptop with
switchable graphics DXGI reports the integrated GPU first and
D3D12CreateDevice(None, ..)takes it, so on a Ryzen 5 8645HS with a Radeon760M and an RTX 4050 every submission went to the Radeon. It asks DXGI for the
high-performance adapter instead and falls back to the default when there is
none. Your
set_host_vendorcall sits right where mine logs, so whicheverlands first, the other is a small rebase. Happy to do mine on top of yours if
that is easier.
Imported from Zettrox/ztrx. Originally posted by PikPakPik on 2026-11-25T09:56:20Z.
Oh nice, hadn't seen #27. Yours is the better home for the adapter log anyway (and picking the right GPU is the real fix for those laptops), so I took mine out. #61 now just grabs the vendor id there and passes it to
set_host_vendor. Whoever gets merged first, the other is a one-line rebase.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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.