D3D12.X: drop conservative rasterization where the GPU has none (amd-dev port of #2038) #2579

Closed
philip-roy-jones wants to merge 204 commits from upstream-pr/2589 into amd-dev
philip-roy-jones commented 2026-11-26 00:38:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by philip-roy-jones on 2026-11-26T00:38:00Z.


Port of #2038 to amd-dev.

On a GPU without conservative rasterization, D3D12 refuses every graphics pipeline that asks for it. The Radeon RX 580 (AMD Polaris, feature level 12_0) reports conservative rasterization tier 0. With the debug layer on, each refusal says ID3D12Device::CreateRasterizerState: Device does not support Conservative Rasterization (pRasterizerDesc specifies D3D12_CONSERVATIVE_RASTERIZATION_MODE_ON) (id 647). The shaders do not matter. amd-dev passes ConservativeRaster through unchanged, so the translated pipeline, its stand-in and the dummy fallback are all refused.

On this RX 580, in a retail title run on amd-dev 04e0b95, the first such pipeline came at 79.2 s. It was refused in all three forms, and the process ended with 0xc0000409 about 5 s later. After the translated pipeline is refused, graphics_pso hands the title's own description, console shaders included, to the driver. Windows Error Reporting has many records of this exit for this PC's XCL builds, in amdxc64.dll 31.0.21925.1001 at offset 0x14e8d85. Keeping console bytecode out of the driver on that path is a separate change. This PR removes the refusal itself, so those pipelines are built.

XCL now reads the tier from D3D12_OPTIONS. Where the GPU has none, it turns conservative rasterization off in the graphics descriptions it makes: the translated pipeline, the stand-in and the dummy fallback. The draws of those pipelines then cover the pixels whose centres their triangles cover, not every pixel a triangle touches, so their edges can differ from the console's. Nothing changes on a GPU that reports a tier. Feature level 12_1 requires tier 1, so only feature level 12_0 GPUs such as this one take the new path.

Part of #1833. Related: #2038 (the same change for main), #303.

What is in it

  • crates/xcl/src/hle/d3d12x/real.rs: conservative_raster (the device's tier) and pc_conservative_raster, called next to pc_topology_type for the translated pipeline, the stand-in and the dummy fallback. It counts the pipelines it drops the flag on in xcl.log (the first five and every 1000th), so a run shows how many there were. #2038 logs it once.
  • crates/xcl/src/hle/d3d12x/real.rs: conservative_raster_tests. An unknown device keeps the flag, and a pipeline that asks for conservative rasterization builds on the test GPU.
  • README.md: one sentence in the GPU notes.

Tested

  • Radeon RX 580 8 GB (driver 31.0.21925.1001), Ryzen 7 7700X, 32 GB, Windows 11 Pro 26200, Rust 1.100.0 MSVC, Windows SDK DXC 1.8.2502.11. Release builds of main 08db802, amd-dev bf02341 and this head e087311 (cargo build --release --locked -p xcl, each from a clean checkout into its own target directory): all exit 0, no new warnings. cargo test --locked --workspace --no-run on the head: exit 0.
  • Pending (queued on the RX 580): the whole suite on the head, the new GPU test with the drop disabled and on WARP, the paired title runs and a debug-layer run of the head. This PR stays a draft until they are in.

Regression run

  • Pending: main 08db802, amd-dev base bf02341 and this head, 300 s each, back to back.

Not tested

  • How the draws of the pipelines that asked for conservative rasterization look without it. Their output was not compared with the console's.
  • Other GPUs without the tier (other Polaris cards) and other AMD drivers. GPUs that report a tier are unaffected by construction. The focused tests cover that path on WARP.
  • Mesh and two-pass (MS / GS) pipelines: their rasterizer subobjects are passed as they are. They need mesh shaders, which this GPU does not have. A feature level 12_2 GPU has both mesh shaders and conservative rasterization.

AI use

  • Claude Code with Claude Opus 5.5 (claude-opus-5-5, reasoning effort max) wrote this port, its log change and the tests' adaptation to amd-dev, ran the builds, tests and title runs on the RX 580, wrote this description, and opened this PR on Philip's instruction. The original change and its tests (#2038) were also written by Claude Code with Claude Opus 5.5. Reviewed on Philip's behalf.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:6616792154 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2589). Originally posted by [philip-roy-jones](https://github.com/philip-roy-jones) on 2026-11-26T00:38:00Z. --- Port of #2038 to amd-dev. On a GPU without conservative rasterization, D3D12 refuses every graphics pipeline that asks for it. The Radeon RX 580 (AMD Polaris, feature level 12_0) reports conservative rasterization tier 0. With the debug layer on, each refusal says `ID3D12Device::CreateRasterizerState: Device does not support Conservative Rasterization (pRasterizerDesc specifies D3D12_CONSERVATIVE_RASTERIZATION_MODE_ON)` (id 647). The shaders do not matter. amd-dev passes `ConservativeRaster` through unchanged, so the translated pipeline, its stand-in and the dummy fallback are all refused. On this RX 580, in a retail title run on amd-dev 04e0b95, the first such pipeline came at 79.2 s. It was refused in all three forms, and the process ended with `0xc0000409` about 5 s later. After the translated pipeline is refused, `graphics_pso` hands the title's own description, console shaders included, to the driver. Windows Error Reporting has many records of this exit for this PC's XCL builds, in `amdxc64.dll` 31.0.21925.1001 at offset `0x14e8d85`. Keeping console bytecode out of the driver on that path is a separate change. This PR removes the refusal itself, so those pipelines are built. XCL now reads the tier from `D3D12_OPTIONS`. Where the GPU has none, it turns conservative rasterization off in the graphics descriptions it makes: the translated pipeline, the stand-in and the dummy fallback. The draws of those pipelines then cover the pixels whose centres their triangles cover, not every pixel a triangle touches, so their edges can differ from the console's. Nothing changes on a GPU that reports a tier. Feature level 12_1 requires tier 1, so only feature level 12_0 GPUs such as this one take the new path. Part of #1833. Related: #2038 (the same change for `main`), #303. **What is in it** - `crates/xcl/src/hle/d3d12x/real.rs`: `conservative_raster` (the device's tier) and `pc_conservative_raster`, called next to `pc_topology_type` for the translated pipeline, the stand-in and the dummy fallback. It counts the pipelines it drops the flag on in `xcl.log` (the first five and every 1000th), so a run shows how many there were. #2038 logs it once. - `crates/xcl/src/hle/d3d12x/real.rs`: `conservative_raster_tests`. An unknown device keeps the flag, and a pipeline that asks for conservative rasterization builds on the test GPU. - `README.md`: one sentence in the GPU notes. **Tested** - Radeon RX 580 8 GB (driver 31.0.21925.1001), Ryzen 7 7700X, 32 GB, Windows 11 Pro 26200, Rust 1.100.0 MSVC, Windows SDK DXC 1.8.2502.11. Release builds of main `08db802`, amd-dev `bf02341` and this head `e087311` (`cargo build --release --locked -p xcl`, each from a clean checkout into its own target directory): all exit 0, no new warnings. `cargo test --locked --workspace --no-run` on the head: exit 0. - Pending (queued on the RX 580): the whole suite on the head, the new GPU test with the drop disabled and on WARP, the paired title runs and a debug-layer run of the head. This PR stays a draft until they are in. **Regression run** - Pending: main `08db802`, amd-dev base `bf02341` and this head, 300 s each, back to back. **Not tested** - How the draws of the pipelines that asked for conservative rasterization look without it. Their output was not compared with the console's. - Other GPUs without the tier (other Polaris cards) and other AMD drivers. GPUs that report a tier are unaffected by construction. The focused tests cover that path on WARP. - Mesh and two-pass (MS / GS) pipelines: their rasterizer subobjects are passed as they are. They need mesh shaders, which this GPU does not have. A feature level 12_2 GPU has both mesh shaders and conservative rasterization. **AI use** - Claude Code with Claude Opus 5.5 (`claude-opus-5-5`, reasoning effort max) wrote this port, its log change and the tests' adaptation to amd-dev, ran the builds, tests and title runs on the RX 580, wrote this description, and opened this PR on Philip's instruction. The original change and its tests (#2038) were also written by Claude Code with Claude Opus 5.5. Reviewed on Philip's behalf. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
upstream-sync closed this pull request 2026-11-26 01:05:32 +00:00
philip-roy-jones commented 2026-11-26 01:05:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by philip-roy-jones on 2026-11-26T00:43:09Z.


Closing this: #2038 already makes this change on main, and amd-dev takes in main regularly.

<!-- greyfinch-sync:ivall/xcl:comment:7179045143 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2589#issuecomment-7179045143). Originally posted by [philip-roy-jones](https://github.com/philip-roy-jones) on 2026-11-26T00:43:09Z. --- Closing this: #2038 already makes this change on main, and amd-dev takes in main regularly.

Pull request closed

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
xcl-dev/xcl!2579
No description provided.