Repository navigation
D3D12.X: drop conservative rasterization where the GPU has none (amd-dev port of #2038) - #2589
Closed
philip-roy-jones wants to merge 1 commit into
Closed
philip-roy-jones wants to merge 1 commit into
philip-roy-jones wants to merge 1 commit into
Conversation
Port of xcl-dev#2038 to amd-dev. The RX 580 (AMD Polaris, feature level 12_0) reports conservative rasterization tier 0, and D3D12 refuses every pipeline that asks for it, whatever its shaders (debug layer id 647: "CreateRasterizerState: Device does not support Conservative Rasterization"). XCL passed ConservativeRaster through unchanged, so the translated pipeline, its stand-in and the dummy fallback were all refused. In a retail title run on amd-dev 04e0b95 the first such pipeline came 79 s in. After its translated form was refused, graphics_pso handed the title's own description, console shaders included, to the driver, and the process ended with 0xc0000409 in amdxc64.dll about 5 s later. XCL now asks D3D12_OPTIONS for the tier and, where the GPU has none, turns conservative rasterization off in the descriptions it makes (translated, stand-in, fallback), counting them in xcl.log. Those draws then cover the pixels whose centres their triangles cover rather than every pixel they touch, so their edges can differ from the console's. Feature level 12_1 requires tier 1, so newer GPUs are not affected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Closing this: #2038 already makes this change on main, and amd-dev takes in main regularly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 passesConservativeRasterthrough 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
0xc0000409about 5 s later. After the translated pipeline is refused,graphics_psohands 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, inamdxc64.dll31.0.21925.1001 at offset0x14e8d85. 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) andpc_conservative_raster, called next topc_topology_typefor the translated pipeline, the stand-in and the dummy fallback. It counts the pipelines it drops the flag on inxcl.log(the first five and every 1000th), so a run shows how many there were. D3D12.X: drop conservative rasterization where the GPU has none #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
08db802, amd-devbf02341and this heade087311(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-runon the head: exit 0.Regression run
08db802, amd-dev basebf02341and this head, 300 s each, back to back.Not tested
AI use
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 (D3D12.X: drop conservative rasterization where the GPU has none #2038) were also written by Claude Code with Claude Opus 5.5. Reviewed on Philip's behalf.🤖 Generated with Claude Code