d3d12: the breakable glass's alpha prepass is left out on AMD cards (D3D12-AMD-GLASS-LEAVE-OUT) #3461

Code

Clone this repository

Checkout

From your project repository, check out a new branch and test the changes.

git fetch -u origin "+refs/pull/3461/head:oreofr/amd-glass-leave-out"
git switch "oreofr/amd-glass-leave-out"
Open
leonida/mandy
OreoFR wants to merge 1 commit from oreofr/amd-glass-leave-out into main AGit

This branch is out-of-date with the base branch

Conversation
Reviewers 0 approvals
  • No reviewers
Details
This pull request is blocked because it's outdated.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3461/head:oreofr/amd-glass-leave-out'
git switch 'oreofr/amd-glass-leave-out'
Member

Claim: D3D12-AMD-GLASS-LEAVE-OUT (#3312)

Port of TrustNo1/Darner 8796899ef (trustno1-coder, GPL-3.0-or-later), rewritten for Mandy.

What

AMD's driver shader compiler faulted building the pipeline of pixel shader cad3ecfdcdcf2a7d (BreakableGlass_AlphaPrepass, with vertex 4afb138ba2e54313) at start, about a minute into loading, in every AMD crash report of Darner's v2026.12.03.01 that named a pipeline (8 logs: RX 9060 XT, RX 7900 XTX and others, drivers 26.6.2 and 26.10.44, amdxc64.dll+0xd7d464/+0xd7d274/+0xcde82c), with the loss guard on or off. Both shaders translate byte for byte as in Darner's build before.

This is a crash in the driver's compiler, not a shader the translator rejects, so it is not a translator skip list (AGENTS.md "Fix, don't disable"). It uses Mandy's existing build-time leave-out, pipeline/make.rs left_out() (the same one that leaves out the ray-tracing resolve without a builder), gated on the host adapter's PCI vendor (AMD, 0x1002): the pipeline is never handed to the driver and its draws count as left out.

  • LEONIDA_AMD_GLASS_PREPASS=1 builds it again (a driver that no longer crashes).
  • NVIDIA, Intel and others: unchanged.
  • The vendor is read once, and only when a pipeline names that shader.

Docs: d3d12/docs/findings.md entry (Darner's measurements, not re-measured here); d3d12/docs/switches.md regenerated.

Tests

  • New pipeline::make::tests::the_glass_prepass_is_left_out_on_amd_cards_only: left out on AMD for every value but 1, never on NVIDIA/Intel/unknown, and 1 does not read the card. Red/green: with the decision forced to false it fails (panic at the AMD assertion); with the change it passes.
  • cargo test -p leonida-gpu --lib --locked: 756 passed, 0 failed.
  • cargo clippy -p leonida-gpu --all-targets --locked -- -D warnings: clean.
  • python -I tests/test_d3d12_switches.py: OK.
  • No game run: this side has no AMD card.

GPUs tested: none in game (RTX 4070 Laptop here, NVIDIA: the path is not taken). Needs an AMD card (ideally one of the crashing configs, RX 9060 XT / RX 7900 XTX on 26.x drivers): start a run, the log should list the pipeline as left out and the load should pass the point where it crashed; with LEONIDA_AMD_GLASS_PREPASS=1 the crash should come back.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

Claim: `D3D12-AMD-GLASS-LEAVE-OUT` (#3312) Port of TrustNo1/Darner `8796899ef` (trustno1-coder, GPL-3.0-or-later), rewritten for Mandy. ## What AMD's driver shader compiler faulted building the pipeline of pixel shader `cad3ecfdcdcf2a7d` (`BreakableGlass_AlphaPrepass`, with vertex `4afb138ba2e54313`) at start, about a minute into loading, in every AMD crash report of Darner's v2026.12.03.01 that named a pipeline (8 logs: RX 9060 XT, RX 7900 XTX and others, drivers 26.6.2 and 26.10.44, `amdxc64.dll`+0xd7d464/+0xd7d274/+0xcde82c), with the loss guard on or off. Both shaders translate byte for byte as in Darner's build before. This is a crash in the **driver's** compiler, not a shader the translator rejects, so it is not a translator skip list (AGENTS.md "Fix, don't disable"). It uses Mandy's existing build-time leave-out, `pipeline/make.rs` `left_out()` (the same one that leaves out the ray-tracing resolve without a builder), gated on the host adapter's PCI vendor (AMD, 0x1002): the pipeline is never handed to the driver and its draws count as left out. - `LEONIDA_AMD_GLASS_PREPASS=1` builds it again (a driver that no longer crashes). - NVIDIA, Intel and others: unchanged. - The vendor is read once, and only when a pipeline names that shader. Docs: `d3d12/docs/findings.md` entry (Darner's measurements, not re-measured here); `d3d12/docs/switches.md` regenerated. ## Tests - New `pipeline::make::tests::the_glass_prepass_is_left_out_on_amd_cards_only`: left out on AMD for every value but `1`, never on NVIDIA/Intel/unknown, and `1` does not read the card. Red/green: with the decision forced to `false` it fails (panic at the AMD assertion); with the change it passes. - `cargo test -p leonida-gpu --lib --locked`: 756 passed, 0 failed. - `cargo clippy -p leonida-gpu --all-targets --locked -- -D warnings`: clean. - `python -I tests/test_d3d12_switches.py`: OK. - No game run: this side has no AMD card. GPUs tested: none in game (RTX 4070 Laptop here, NVIDIA: the path is not taken). **Needs an AMD card** (ideally one of the crashing configs, RX 9060 XT / RX 7900 XTX on 26.x drivers): start a run, the log should list the pipeline as left out and the load should pass the point where it crashed; with `LEONIDA_AMD_GLASS_PREPASS=1` the crash should come back. AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
AMD's driver shader compiler faulted building the pipeline of pixel shader
cad3ecfdcdcf2a7d (BreakableGlass_AlphaPrepass, with vertex 4afb138ba2e54313)
at start, about a minute into loading, in every AMD crash report of Darner's
v2026.12.03.01 that named a pipeline (8 logs, RX 9060 XT, RX 7900 XTX and
others, drivers 26.6.2 and 26.10.44). Both shaders translate; the fault is the
driver's compile. pipeline/make.rs left_out() now leaves that pipeline out when
the host adapter's vendor is AMD (0x1002), as it leaves out the ray-tracing
resolve without a builder; LEONIDA_AMD_GLASS_PREPASS=1 keeps it. Other vendors
are unchanged. findings.md entry; switches.md regenerated.

Item: D3D12-AMD-GLASS-LEAVE-OUT
Port of TrustNo1/Darner 8796899ef (trustno1-coder), GPL-3.0-or-later; there
`darner play` adds the hash to DARNER_LEAVE_OUT on AMD cards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OreoFR referenced this pull request from a commit 2026-12-04 14:36:14 +00:00
First-time contributor

Test report from another machine (I changed no code). Not a review of the code.

  • Head f5cadd592 merged onto main 93b9d90a2: clean merge.
  • RTX 3060 Ti 8 GB, driver 610.88, Intel i7-13700KF, Windows 11, 32 GB RAM.
  • cargo test -p leonida-gpu --lib --locked -- --test-threads=1: 791 passed, 0 failed, 60 ignored (main: 790 passed).
  • The new test pipeline::make::tests::the_glass_prepass_is_left_out_on_amd_cards_only passed.
  • python -I tools/d3d12_switches.py --check d3d12/docs/switches.md: exit 0.
  • This is an NVIDIA card, so it says nothing about the AMD path the change is for. Not run: the real-card (--ignored) tests, clippy, the clean-room check, any in-game run.

GPUs tested: RTX 3060 Ti 8 GB, driver 610.88. No game files were used.

AI-assisted: yes (Claude Code, Claude Fable 5.2; verification only).

Test report from another machine (I changed no code). Not a review of the code. - Head `f5cadd592` merged onto `main` `93b9d90a2`: clean merge. - RTX 3060 Ti 8 GB, driver 610.88, Intel i7-13700KF, Windows 11, 32 GB RAM. - `cargo test -p leonida-gpu --lib --locked -- --test-threads=1`: **791 passed, 0 failed**, 60 ignored (`main`: 790 passed). - The new test `pipeline::make::tests::the_glass_prepass_is_left_out_on_amd_cards_only` passed. - `python -I tools/d3d12_switches.py --check d3d12/docs/switches.md`: exit 0. - This is an NVIDIA card, so it says nothing about the AMD path the change is for. Not run: the real-card (`--ignored`) tests, clippy, the clean-room check, any in-game run. GPUs tested: RTX 3060 Ti 8 GB, driver 610.88. No game files were used. AI-assisted: yes (Claude Code, Claude Fable 5.2; verification only).
Sign in to join this conversation.
No description provided.