Shaders: fix the AMD RDNA 4 compiler crash: a buffer's size through a non-uniform handle of its own (DexNom PR 62) #559

Merged
BackseatDrivers-Unbound merged 1 commit from upstream-pr/559 into main 2026-11-29 08:16:59 +00:00
BackseatDrivers-Unbound commented 2026-11-28 00:54:16 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by BackseatDrivers-Unbound on 2026-11-28T00:54:16Z.


The shader fix from #504, as you asked: nothing else in this PR (2 files, +40/-1).

What it fixes. On AMD RDNA 4, the driver's shader compiler crashes the whole game (amdxc64.dll+0x861b9f) on 10 of the title's compute shaders: tree/particle culling f16876929fa64f9f, 878933b499cfa14d, a567b9ef845fb680, c1eee35dbc50a9ef, and ray-tracing resolve a4df980a1c65fdbe, d0130073bb6f7a7d, 7b956e1f6d56609f, 0ae69044bfd15035, d2c52fcd936985b4, 1e4947eada3d9ee3. Probably also #239 (RX 9060 XT).

How. In descriptor_data, the buffer size query now gets a heap handle of its own (the loads' raw twin index included), marked non-uniform and not counted in nonuniform_handles, instead of sharing the uniform handle the loads use (crates/victory-shader/src/emit/lower/amd.rs, called from lower.rs). The approach is IxMxAMAR's (fxceless/victory-fork#1213); Toucann turned it into DexNom/VIctory PR 62; this is the size-query part of that, ported unchanged.

Tested on an RX 9070 XT (driver 32.0.32029.2010) on top of 64d4931b:

  • compiling those shaders on their own in a child process: all 10 crash without it, none with it (plus a control shader that builds either way);
  • cargo test -p victory-shader -- --test-threads=1: passes (one test, size_tests::the_record_count_of_a_structured_buffer_read_by_index, crashes the test process on 29d8dbf7 too, before this change, so it was skipped);
  • play sessions on the Series X profile with no crashes: on 64d4931b five sessions with ray tracing off; on 29d8dbf7 (same fix) ray tracing off and on.
    Not tested on NVIDIA cards. It only changes how the size query's handle is made; DexNom's evaluation of PR 62 found its other outputs byte-identical and the changed shaders computing the same values.

No version to bump: the shader cache keys on the BLAKE3 of victory-shader's sources, so older cached translations aren't served.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5535120083 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/559). Originally posted by [BackseatDrivers-Unbound](https://github.com/BackseatDrivers-Unbound) on 2026-11-28T00:54:16Z. --- The shader fix from #504, as you asked: nothing else in this PR (2 files, +40/-1). **What it fixes.** On AMD RDNA 4, the driver's shader compiler crashes the whole game (`amdxc64.dll+0x861b9f`) on 10 of the title's compute shaders: tree/particle culling `f16876929fa64f9f`, `878933b499cfa14d`, `a567b9ef845fb680`, `c1eee35dbc50a9ef`, and ray-tracing resolve `a4df980a1c65fdbe`, `d0130073bb6f7a7d`, `7b956e1f6d56609f`, `0ae69044bfd15035`, `d2c52fcd936985b4`, `1e4947eada3d9ee3`. Probably also #239 (RX 9060 XT). **How.** In `descriptor_data`, the buffer size query now gets a heap handle of its own (the loads' raw twin index included), marked non-uniform and not counted in `nonuniform_handles`, instead of sharing the uniform handle the loads use (`crates/victory-shader/src/emit/lower/amd.rs`, called from `lower.rs`). The approach is IxMxAMAR's (fxceless/victory-fork#1213); Toucann turned it into DexNom/VIctory PR 62; this is the size-query part of that, ported unchanged. **Tested** on an RX 9070 XT (driver 32.0.32029.2010) on top of `64d4931b`: - compiling those shaders on their own in a child process: all 10 crash without it, none with it (plus a control shader that builds either way); - `cargo test -p victory-shader -- --test-threads=1`: passes (one test, `size_tests::the_record_count_of_a_structured_buffer_read_by_index`, crashes the test process on `29d8dbf7` too, before this change, so it was skipped); - play sessions on the Series X profile with no crashes: on `64d4931b` five sessions with ray tracing off; on `29d8dbf7` (same fix) ray tracing off and on. Not tested on NVIDIA cards. It only changes how the size query's handle is made; DexNom's evaluation of PR 62 found its other outputs byte-identical and the changed shaders computing the same values. No version to bump: the shader cache keys on the BLAKE3 of victory-shader's sources, so older cached translations aren't served. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
trustno1-coder/VIctory-NVIDIA!559
No description provided.