Skip to content

D3D12.X: drop conservative rasterization where the GPU has none - #2038

Open
philip-roy-jones wants to merge 1 commit into
xcl-dev:mainfrom
philip-roy-jones:d3d12x-no-conservative-raster
Open

philip-roy-jones wants to merge 1 commit into
xcl-dev:mainfrom
philip-roy-jones:d3d12x-no-conservative-raster

Conversation

@philip-roy-jones

@philip-roy-jones philip-roy-jones commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

On a GPU without conservative rasterization, the driver refuses every graphics pipeline that asks for it. The Radeon RX 580 (AMD Polaris) is one such GPU. It reports D3D12_CONSERVATIVE_RASTERIZATION_TIER_NOT_SUPPORTED, and its driver returns E_INVALIDARG for the translated pipeline, its stand-in and the dummy fallback alike. In a diagnostic run of the retail title on main 80f4819 (logging added around the stand-in calls), all 12 stand-ins with ConservativeRaster on were refused and all 54,193 without it were made.

On this RX 580 the failure also ends the process. After the translated pipeline is refused, graphics_pso passes the title's own description, console shaders included, to the driver, and amdxc64.dll fast-fails (0xc0000409 at offset 0x14e8d85, driver 31.0.21925.1001) before XCL writes its final frame count. #303 keeps console bytecode out of the driver on that path. This PR removes the refusal itself, so those pipelines are built and drawn.

XCL now reads the tier from D3D12_OPTIONS, and where the GPU has none it turns conservative rasterization off in the graphics descriptions it makes. Those draws then cover the pixels whose centres their triangles cover.

Part of #1833. Related: #303.

What is in it

  • crates/xcl/src/hle/d3d12x/real.rs: conservative_raster (the device's tier) and pc_conservative_raster. The latter is called next to pc_topology_type for the translated pipeline, the stand-in and the dummy fallback, and logs once when it drops the flag.
  • 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

  • Rebased head ba5a120 and main 1a0bbe3. Radeon RX 580 8 GB, driver 31.0.21925.1001, Ryzen 7 7700X, 32 GB, Windows 11 Pro 26200.9974, Rust 1.100.0 MSVC, Windows SDK DXC 1.8.2502.11. Debug tests and release title runs. Optional XCL_SAMPLE_* inputs were unset.
  • On both commits, cargo build --locked --workspace, cargo test --locked --workspace --no-run and cargo build --release --locked -p xcl succeeded.
  • On ba5a120, xcl-gpu run cargo test --locked -p xcl --lib conservative_raster -- --nocapture with XCL_ADAPTER=RX 580 and XCL_ADAPTER=warp gave 2 passed, 0 failed, 0 ignored and 0 skipped per adapter. The RX 580 dropped the flag and WARP kept it. Both built the pipeline. A separate D3D12 query reported tiers 0 and 3 respectively.
  • xcl-gpu run cargo test --locked --workspace --no-fail-fast -- --test-threads=4 with XCL_ADAPTER=RX 580 exited 101 on both commits.
RX 580 workspace suite Passed Failed Ignored SKIPPED messages (distinct tests)
Main 1a0bbe3 1,136 114 46 85 (70)
PR ba5a120 1,138 114 46 86 (71)

The same 114 tests failed by name and error category on both commits. 107 reported device removal (0x887A0005), 6 reported invalid arguments (0x80070057), and the sparse-VRAM test failed its GPU address assertion. Libtest counts a test that returns after printing SKIPPED as passed. The extra PR skip was the new GPU test reporting no GPU during the full run. It passed separately above.

RX 580 skip reasons
Reason Main PR
D3D12 device creation reported an internal driver error 2 2
no GPU 16 17
no GPU / DXC / mesh shaders 1 1
no GPU with 32-lane waves 41 41
no heap windows 1 1
no mesh shaders 5 5
no wave32 17 17
no wave32 / wave64 1 1
no xgameruntime.dll 1 1

With default pipeline settings and the same starting cache, main fast-failed in amdxc64.dll (0xc0000409, offset 0x14e8d85) before writing its final frame count. The PR logged the downgrade and finished 60 s with 1,107 frames, 15,185 MB peak commit, 0 device removals and 0 crashes. On the original head e147de1, removing the normalization call from the focused GPU test reproduced E_INVALIDARG on this RX 580. That revision completed the previous default 60-second menu run with 1,216 frames. Original smoke output

Regression run

Both clean release builds ran the same retail title for 60 s without input on the RX 580. Each started with an empty data root and a separate copy of the same 3,300-file shader and driver cache. The executable path was the same. The paired settings were XCL_ADAPTER=RX 580, XCL_DIRECT_DXIL=0, XCL_ASYNC_PSO=0, XCL_PSO_PRELOAD=0, XCL_DXC_THREADS=2. The default-pipeline run above exercised the downgrade. The synchronous PR run did not log it.

xcl-gpu run .\scripts\smoke.ps1 -Game <retail-folder> -Xcl <release-exe> -Title Retail -Seconds 60 -OutDir <run-output>

Main 1a0bbe3

xcl-smoke v1
commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6
gpu: Radeon RX 580 Series
title: Retail
seconds: 60
exit: 0x0
frames shown: 52 (PresentX 52)
presents per 2 s (last 3): 0 0 51
device removals: 0
crashes: 0
peak commit: 10777 MB

PR ba5a120

xcl-smoke v1
commit: ba5a1207830b11a9ae2a79c58a1d84f958ab3c11
gpu: Radeon RX 580 Series
title: Retail
seconds: 60
exit: 0x0
frames shown: 218 (PresentX 218)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 10951 MB

The earlier synchronous direct-DXIL settings (XCL_DIRECT_DXIL=1) lost the device during the same sequence of translated compute pipeline creations on both builds. At 120 s, main exited 0x887a0020 at 95.084 s and the PR exited 0x887a0020 at 42.550 s. At 60 s both exited 0x887a0020 at 31.908 s and 31.817 s respectively. Each run reported one device removal and ended before writing a final frame count.

Not tested

  • Physical NVIDIA, Intel and AMD RDNA on this rebased head. The earlier Arc A770, RTX 3060 and RTX 3060 Ti reports cover the original submission.
  • Other GPUs without the tier (other Polaris cards) and other AMD drivers.
  • How the passes that asked for conservative rasterization look without it. Only that their pipelines build was checked.
  • World load and gameplay: these runs stayed in the menus.
  • Mesh and two-pass (MS / GS) pipelines: their rasterizer subobjects are left as they are. They need mesh shaders, which this GPU does not have.
  • Full workspace suite on WARP. The two focused WARP tests ran on this head.

AI use

  • Claude Code with Claude Opus 5.5 (claude-opus-5-5; its reasoning-effort setting is not visible to it). It ran the title and diagnostic builds on the RX 580, found the cause, and wrote the change, the tests and the original description. Philip Roy Jones asked for this PR, and it is opened from their account.
  • On the original head e147de1, OpenAI Codex, GPT-6.2 Astra at maximum reasoning effort, rebuilt the PR and its base, ran the matched RX 580 comparison, checked the two adapter tiers, ran the focused RX 580 and WARP tests, and updated the test evidence.
  • OpenAI Codex, GPT-6.2 Astra at maximum reasoning effort, resolved the rebase conflict, compared the full diff with the original patch, ran both builds and their RX 580 suites and retail comparisons, checked WARP, and updated this description.

🤖 Generated with Claude Code

@raylitebull

Copy link
Copy Markdown
Member

Code review on e147de1:

  • conservative_raster (checking D3D12_FEATURE_DATA_D3D12_OPTIONS::ConservativeRasterizationTier != D3D12_CONSERVATIVE_RASTERIZATION_TIER_NOT_SUPPORTED) and pc_conservative_raster across translated_graphics_pso_once, standin_graphics, and graphics_pso cleanly drop ConservativeRaster only on GPUs without support (e.g., RX 580) while preserving it on supported hardware.
  • an_unknown_device_keeps_conservative_rasterization and a_pipeline_asking_for_conservative_rasterization_builds verify both the null-device default and live adapter PSO creation.
  • Build and test (Windows, no GPU) is currently running; PR description failed because the main xcl-smoke block crashed before a frame (0xc0000409 / frames shown: none logged).

Remaining before merge:

  1. Confirm Build and test finishes green and resolve PR description (a baseline comparison block from a non-crashing configuration or maintainer override on the crash-fix exception).
  2. An NVIDIA (and/or RDNA) verification pass confirming conservative rasterization remains enabled and the suite + new test pass on e147de1.

@philip-roy-jones

Copy link
Copy Markdown
Contributor Author

Both required checks now pass on e147de1. The PR description includes the matched 120 s retail runs on the RX 580. Main showed 3,189 frames and the PR showed 3,313, with zero crashes and device removals on both. The original default-settings crash is documented under Tested. PR description check · Windows CI

The focused tests also ran on both conservative-rasterization paths on this machine. With XCL_ADAPTER=RX 580 (Radeon RX 580, driver 31.0.21925.1001, tier 0) and XCL_ADAPTER=warp (Microsoft WARP, tier 3), xcl-gpu run cargo test --locked -p xcl --lib conservative_raster -- --nocapture returned 2 passed, 0 failed, 0 ignored and 0 skipped per adapter. WARP kept the flag and created the pipeline.

The physical NVIDIA or RDNA run is still open. If someone with either adapter can run the focused test and cargo test --locked --workspace --no-fail-fast -- --test-threads=4 on e147de1 and post the GPU, driver and counts, that would cover the remaining review request.

OpenAI Codex, GPT-6.2 Astra at maximum reasoning effort, ran the comparison and focused tests and wrote this follow-up.

@JJAutoCompare

Copy link
Copy Markdown

PR #2038 — D3D12.X conservative rasterization on Intel Arc A770

Tested live PR head e147de1ed077ea8f641689523a954f1e266ad372 from refs/pull/2038/head on xcl-dev/xcl. The worktree was clean at build time and after the run. origin/main was cbc296ab65a2661a61e3e2da109134bcd5319f60. git merge-tree --write-tree origin/main HEAD exited 0 and produced tree dc46a30f21aff4a048daa125be47996d0a41eda9.

What is in it

  • crates/xcl/src/hle/d3d12x/real.rs checks device support before requesting conservative rasterization for affected pipeline descriptors and adds two tests. README.md documents the fallback.

Tested

  • STOR-WINLAB, Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 16 GiB with driver 32.0.101.9175. The adapter has waves of 8–32 lanes and DoublePrecisionFloatShaderOps=0. The test-title runner confirmed the A770 and DXC 1.9.2609.5. The assigned DXC/DXIL directory was %LOCALAPPDATA%\XclTooling\dxc-1.9.2609\bin\x64. Rust was rustc 1.100.0 (0ef1bc386 2026-11-09). Dev and test profiles were unoptimized with debug info and incremental compilation disabled. Build output, temporary files, XCL data and the DXIL cache were directed to the assigned L: slot.
  • cargo build --workspace and cargo test --workspace --no-run both exited 0 outside the GPU lock. Both emitted the existing Atomic::fetch_update deprecation warnings.
  • cargo test -p xcl --lib hle::d3d12x::real::conservative_raster_tests::an_unknown_device_keeps_conservative_rasterization -- --exact --show-output ran outside the lock. 1 passed, 0 failed, 0 ignored, 0 skip markers.
  • cargo test -p xcl --lib hle::d3d12x::real::conservative_raster_tests::a_pipeline_asking_for_conservative_rasterization_builds -- --exact --show-output ran under Invoke-ArcTest.ps1. 1 passed, 0 failed, 0 ignored, 0 skip markers. The descriptor passed the support assertion and the A770 accepted the graphics PSO. The fallback log message did not appear.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 --show-output ran once under Invoke-ArcTest.ps1 and exited 101. Across 20 test result summaries, libtest reported 1038 passed, 26 failed, 45 ignored. It emitted 26 skip markers across 16 distinct tests. The raw pass count includes tests that returned after a skip and optional sample tests that returned early. Skipped cases contribute no coverage. Both PR-specific tests also passed in this run.
  • The library target had 25 failures. In 21, CreateComputePipelineState returned 0x80070057; several of those tests exercise f64. The other four failed assertions for FMA contraction, implicit mip LOD, f16 lane preservation, and whole-wave pixel reductions. The e2e target had one failure: test_title_runs_and_game_folder_is_untouched read blue where the dynamic depth bias check expected green. A main baseline would be needed to establish whether these failures are regressions.
  • Logs in L:\XclTooling\neon-slot-1\tmp: pr2038-build.log, pr2038-targeted.log, pr2038-suite.log.

Skip markers

Each entry below is from the workspace run. Some tests report a reason for each skipped case.

SKIPPED gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu: const_mask, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 arithmetic, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 compares, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer arithmetic, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 rounding, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer carries, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 transcendentals, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 three-source, wave64: no wave64
SKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64
SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64
SKIPPED shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cache (Windows Developer Mode is required): The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D)
SKIPPED placed_title_textures_share_vram_and_preserve_pixels: tiled tier < 2
SKIPPED test_title_draws_with_a_root_signature_under_the_debug_layer: no d3d12SDKLayers.dll
SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows
SKIPPED uploads_start_from_each_subresources_state: no D3D12 debug layer (The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D))

Not tested

  • The RX 580 and the behavior on an adapter that reports conservative rasterization as unsupported. AMD and NVIDIA hardware were outside this run.
  • Retail-title smoke on main and PR head, a main baseline suite, and optional retail or console SDK sample data. The XCL_SAMPLE_* inputs were unset.

AI use

  • T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and tests and drafted this report. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified the counts against pr2038-suite.log and published this report.

@JoaoPauluu

Copy link
Copy Markdown

A regression run under Wine on Linux on the retail title: no device removal, no crash, frames level with main (1353 here, 1357 and 1365 on the two main runs). This GPU has conservative rasterization, so the new path (and its no conservative rasterization log line) is not reached here; this is a regression run only.

Tested

Regression run

main (first run):

xcl-smoke v1
commit: cbc296ab65a2661a61e3e2da109134bcd5319f60
gpu: NVIDIA GeForce RTX 3060
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1357 (PresentX 1357)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 0 MB

this PR:

xcl-smoke v1
commit: e147de1ed077ea8f641689523a954f1e266ad372
gpu: NVIDIA GeForce RTX 3060
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1353 (PresentX 1353)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 0 MB

The second main run: 1365 frames, exit: 0x0, no device removal, no crash. Under Wine, peak commit reads 0 MB, so these blocks do not check memory.

Not tested

  • the test suite on this head, a GPU without conservative rasterization (the case the PR is for), native Windows.

AI use

  • Claude Code (Claude Opus 5.5) built both commits, ran the runs and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

Thanks!

@raylitebull

Copy link
Copy Markdown
Member

Update: #2038 now has AMD RX 580 + Intel Arc A770 + NVIDIA RTX 3060 / 3060 Ti verification on e147de1, and recent merges on main introduced a merge conflict (DIRTY). @philip-roy-jones — please rebase onto latest main so CI runs cleanly.

The RX 580 (AMD Polaris) reports no conservative rasterization tier,
and its driver refuses every pipeline that asks for it with
E_INVALIDARG: the translated pipeline, its stand-in and the dummy
fallback alike. In a retail title run on main (80f4819, with logging
added), all 12 stand-ins with ConservativeRaster on were refused and
all 54,193 without it were made. After the translated pipeline was
refused, graphics_pso handed the title's own description, console
shaders included, to the driver, and AMD's shader compiler ended the
process with 0xc0000409 before the first frame (xcl-dev#303 guards that path
on its own).

XCL now asks D3D12_OPTIONS for the tier and turns conservative
rasterization off in the descriptions it makes (translated, stand-in,
fallback) where the GPU has none. Those draws then cover the pixels
whose centres their triangles cover. On the RX 580 the title ran its
menus for 120 s at 30 fps with default settings, with no pipeline
refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@philip-roy-jones
philip-roy-jones force-pushed the d3d12x-no-conservative-raster branch from e147de1 to ba5a120 Compare November 25, 2026 11:47
@throny throny added the goal:world-load Bears on the retail title getting past world loading label Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

goal:world-load Bears on the retail title getting past world loading

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants