Repository navigation
Shaders: mark buffer getDimensions heap handles non-uniform for AMD - #452
MalfoyDraco99 wants to merge 2 commits into
Conversation
|
An RDNA3 data point for this change. The synthetic test doesn't reproduce the crash on this card. Setup: AMD Radeon RX 7800 XT (RDNA3), driver 32.0.32029.2010, Windows 11 Pro build 26300, Rust 1.98.1, this PR's head
So on RDNA3 with this driver, this synthetic shader doesn't hit the crash either way. Either the crash is RDNA4-specific (#120 and #145 are on RX 9070 XT), or it needs something the captured program has and this shader doesn't. If the captured program has a shape that crashes on the old path, building the test from it, with the old handle as the failing case, would make it a regression test. I'm happy to run such a version on this card. AI-assisted (Claude Code): it ran the tests and the uniform-handle variant on my machine and drafted this. |
|
@Frtuchinno I've pushed an updated Setup: AMD Radeon RX 9060 XT (RDNA4), driver
If you have a moment to re-test this version on your RX 7800 XT (same driver), it'd be useful to see whether the divergent-branch shape also hits AI-assisted (Gemini 4 Hydrogen): minimized the synthetic reproducer, ran the tests/clippy checks, and helped draft this. |
…roduce amdxc64 crash Lower a 19-dword synthetic GFX10 compute shader through the full pipeline with a divergent branch containing SRV descriptor load, buffer getDimensions, and buffer_load_dword. Reproduces amdxc64.dll+0x861b9f (0xc0000005) on RX 9060 XT (driver 32.0.32029.2010) when getDimensions uses a uniform handle, and passes with heap_handle_for_buffer_dim. Co-Authored-By: Gemini 4 Hydrogen <noreply@google.com>
|
Test report: this PR's head no longer merges into AI-assisted (Claude Code); no game data. |
Problem
Addresses part of #120 and #145.
On AMD RDNA 4 GPUs (tested on RX 9060 XT, driver
32.0.32029.2010),amdxc64.dll+0x861b9fcrashes (0xc0000005, null read at+0x8) insideCreateComputePipelineStateon livedx.op.getDimensionscalls over heap-indexedByteAddressBufferhandles marked uniform (createHandleFromHeap(..., nonUniformIndex = false)) inside divergent control flow, even though the emitted DXIL passesdxil.dllvalidation.This is a separate trigger from the cross-block
REUSEpass crash addressed in #195 / #317 — it reproduces even withVICTORY_SHADER_OPT=0(including compute shaderf16876929fa64f9f, which #195 still had to skip).Fix
Shader::heap_handle_for_buffer_dimincrates/victory-shader/src/emit/shader.rsto emitnonUniformIndex = truespecifically for buffergetDimensionshandles without distortingnonuniform_handles.descriptor_dataincrates/victory-shader/src/emit/lower.rsto useheap_handle_for_buffer_dimfor non-waterfall buffergetDimensionswithout caching the handle inself.handles, keeping normal buffer loads/stores uniform.raw_buffer_get_dimensions_compiles_on_hostincrates/victory-shader/src/emit/mod.rslowering a synthetic 19-dword GFX10 compute shader with a divergent branch through the full pipeline (reproducesamdxc64.dll+0x861b9fwithnonUniformIndex = falseon RX 9060 XT; passes DXIL validation andCreateComputePipelineStatewith this fix, and skips cleanly on software adapters / hosted CI).Tested
cargo clippy --workspace --all-targets --locked -- -D warningscargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo test --workspace --locked32.0.32029.2010, Windows 11, Rust 1.98.1):f16876929fa64f9fpassesdxil.dllvalidation andCreateComputePipelineState, and title launch ran past frame 512 with zeroamdxc64.dllcrashes.