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

  • 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, DXC 1.8.2502.11 (Windows SDK 10.0.26100.0). Tests in debug, title runs in release.
  • xcl-gpu run cargo test --locked -p xcl --lib conservative_raster -- --nocapture on e147de1, once with XCL_ADAPTER=RX 580 and once with XCL_ADAPTER=warp. Each run returned 2 passed, 0 failed, 0 ignored and 0 skipped. A separate D3D12_OPTIONS query reported tier 0 on the RX 580 and tier 3 on Microsoft WARP. The RX 580 dropped the flag and WARP kept it. Both created the pipeline. Removing the normalization call from the GPU test made it fail with E_INVALIDARG on the RX 580.
  • cargo test --locked --workspace --no-fail-fast -- --test-threads=4:
    • PR head e147de1: 969 passed, 95 failed, 45 ignored; 60 SKIPPED.
    • main 656c0e8: 967 passed, 95 failed, 45 ignored; 59 SKIPPED.
    • The same 95 tests failed on both commits. The full PR run counted the new GPU test as a pass after it reported SKIPPED …: no GPU following earlier device removals. Both new tests ran in the focused RX 580 pass above.
  • With the default pipeline settings, main 656c0e8 exited with 0xc0000409 in amdxc64.dll. Its activity log recorded 191 presents before the crash. The final frame count is unavailable and peak commit was 11,429 MB. The PR head completed 60 s with 1,216 frames and 15,679 MB peak commit. It logged the conservative-raster downgrade and no graphics stand-in failure. It also completed a 120 s default run with 2,905 frames. Original smoke output

Regression run

Both release builds ran the same retail title on the RX 580 for 120 s with no input. Main can finish the comparison with synchronous pipelines. Both runs used XCL_DIRECT_DXIL=1, XCL_ASYNC_PSO=0, XCL_PSO_PRELOAD=0 and XCL_DXC_THREADS=2. Each started with an empty XCL_DATA_ROOT and a separate copy of the same 3,300-file XCL_DXIL_CACHE snapshot, including driver blobs. Both used the same executable path. The earlier 60 s synchronous runs varied from 1 to 1,429 frames on main and from 289 to 820 on the PR with a shared writable cache.

From each clean checkout, cargo build --release --locked -p xcl, then xcl-gpu run .\scripts\smoke.ps1 -Game <retail-folder> -Xcl <release-exe> -Title Retail -Seconds 120. The PR did not log a conservative-raster downgrade in this configuration. The default run above exercised it.

xcl-smoke v1
commit: 656c0e8ca070bdc9d7cb197d264792ef49304865
gpu: Radeon RX 580 Series
title: Retail
seconds: 120
exit: 0x0
frames shown: 3189 (PresentX 3189)
presents per 2 s (last 3): 3 60 57
device removals: 0
crashes: 0
peak commit: 69265 MB
xcl-smoke v1
commit: e147de1ed077ea8f641689523a954f1e266ad372
gpu: Radeon RX 580 Series
title: Retail
seconds: 120
exit: 0x0
frames shown: 3313 (PresentX 3313)
presents per 2 s (last 3): 59 58 42
device removals: 0
crashes: 0
peak commit: 79194 MB

Not tested

  • Physical NVIDIA, AMD RDNA and Intel GPUs with conservative rasterization. The requested suite and focused test on NVIDIA or RDNA hardware are still outstanding.
  • 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.
  • The full suite on WARP locally. The 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.
  • OpenAI Codex, GPT-6.2 Astra at maximum reasoning effort, rebuilt both commits, ran the matched RX 580 comparison, checked the two adapter tiers, ran the focused RX 580 and WARP tests, and updated the test evidence.

🤖 Generated with Claude Code

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>
@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants