D3D12.X: forward RSSetShadingRate to ID3D12GraphicsCommandList5 #1944
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1944
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1944"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@fixgep on GitHub · 2026-11-24 23:46 UTC · original
fixgep:feat/d3d12x-rs-set-shading-rate→main· +256 −4 · 3 files · 1 commits · openThe console command list's
RSSetShadingRatesits at#124on the base console layout and at#126on the newer layout.mainalready remapped the base slot straight to the PC'sID3D12GraphicsCommandList5::RSSetShadingRate(PC#77), while the newer slot#126was unrouted and fell into the console-extension stub (ID3D12GraphicsCommandList10::#126 (not on PC)). Both slots now route through a single capability-gated handler. Part of #505.What is in it
crates/xcl/src/hle/d3d12x/device_x.rs: probe and cacheD3D12_FEATURE_DATA_D3D12_OPTIONS6(VariableShadingRateTier,AdditionalShadingRatesSupported) on the underlying PCID3D12Deviceat creation and log it once (probe_vrs,vrs).crates/xcl/src/hle/d3d12x/list_x.rs: addrs_set_shading_rate_x— clean no-op without host VRS; otherwise sanitize the base rate (clamp unsupported axes to 2X/4X perAdditionalShadingRatesSupported) and combiners (unknown combiners ->PASSTHROUGH, unreadablecombinerspointer ->NULLdefaults) before forwarding toID3D12GraphicsCommandList5::RSSetShadingRate, and record/re-apply the state acrossKickoffXand mid-list splits (restore_bindings).crates/xcl/src/hle/d3d12x/real.rs: route console#124throughrs_set_shading_rate_xinstead of the bare PC remap and map newer-layout#126to#124inNEWER_LIST_SLOTS(title_listwrappers inherit this through the extended vtable).device_x.rs/list_x.rs/real.rs): slot-routing table assertions, rate/combiner sanitization unit tests, null-list no-op test, and an isolated child-process D3D12 debug-layer forwarding test.Tested
32.0.15.9144), AMD Ryzen 5 7500F 6-Core Processor, Windows 11 Pro x64 (build 26200),rustc 1.100.0 (0ef1bc386 2026-11-09); debug and releasecargo test --workspace --no-fail-fast -- --test-threads=4: 979 passed, 1 failed, 45 ignored (xcl --lib: 930 passed, 1 failed, 25 ignored; 16xclintegration targets: 49 passed, 0 failed, 20 ignored;xclbin /xcl-testtitle/ doc-tests: 0 tests). SKIPPED GPU tests: 21 ingpu::recomp(no wave64/ unsupported wave32 per-laneV_MUL_F16,V_PK_MUL_F16,V_CVT_F16_F32), 1 inshaders::tests::pso_measurement_compiles_an_exact_synthetic_record(Windows Developer Mode required to disable driver cache), and 1 ingpu_compute_e2e::heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows). The single failure (gpu::recomp::tests::gpu_clamp_and_omod_per_instruction,v_pk_add_i16clamp) is pre-existing onmainon this GPU/driver.cargo test -p xcl --test '*' -- --test-threads=4: 49 passed, 0 failed, 20 ignored (1 SKIPPED:heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows)title: 3c290c16, 60 s releasescripts/smoke.ps1):main(689f2db) logged[STUB] d3d12_xs.dll!ID3D12GraphicsCommandList10::#126 (not on PC)(1061frames);30862adloggedD3D12.X: variable shading rate (OPTIONS6): tier 2, additional rates true, cleared the#126stub warning, and reached1099frames with 0 crashes / 0 device removals.Regression run
main:
PR:
Not tested
SV_ShadingRatereadback draw) from the forwarded shading rate#126identity on other titles: #1049 decodes#126as a stencil-ref setter on another runtime; while a title passes zeroed arguments this sanitized forward acts as default rate/combiners (flagged for review)RSSetShadingRateImage(console#125/ newer#127) is out of scopeAI use
GLM-5.4): wrote the implementation and unit/GPU tests in30862adand ran thexcl-smokeruns.Gemini 4 Hydrogen): verified the full workspace test suite, reviewed the diff and retail title run logs, validated the PR description withscripts/pr_check.py, and finalized this PR description.@futurepro62 on GitHub · 2026-11-24 23:56 UTC · original · edited 2026-11-25 00:04 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
30862ad(on its base689f2db).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::dxil::fuzz_tests: 970 passed, 0 failed, 43 ignored. SKIPPED (no wave64):a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu,a_per_lane_2d_or_3d_group_runs_on_the_gpu,coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu,cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.sanitize_shading_rate_clamps_to_what_the_adapter_supports,rs_set_shading_rate_x_without_a_list_is_a_no_op,rs_set_shading_rate_x_forwards_without_debug_layer_errors,rs_set_shading_rate_x_debug_layer_child,shading_rate_slots_run_the_handler.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 979 passed, 0 failed, 45 ignored. SKIPPED:f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),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))),f16_programs_on_the_gpu(f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),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))),f32_programs_on_the_gpu(f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipleaves out tests that fail on main62265d3too, not because of this PR. On NVIDIA:heap_window_out_of_memory_falls_back_to_the_switch_form(#1651) and the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests (follow-up on #1651) fail becauserunner::skip_testturns their skips into failures underXCL_REQUIRE_GPU=mesh, andgpu::dxil::fuzz_testsseeds 70, 545, 1019 and 1507 failCreateComputePipelineStatewithE_OUTOFMEMORYon this card (drivers 616.64 and 621.40). On AMD:fuzz_validate_and_gpu_1fails on seed 540 (res[833]0x7 vs CPU 0x6). The AMD run does not setXCL_REQUIRE_GPU.Not tested
AI use
@raylitebull on GitHub · 2026-11-25 01:54 UTC · original
Code review on
30862ad:D3D12_FEATURE_DATA_D3D12_OPTIONS6(device_x::probe_vrs/vrs()), routing consoleRSSetShadingRate(#124andNEWER_LIST_SLOTS#126) throughlist_x::rs_set_shading_rate_x, clamping unsupported axes viasanitize_shading_rate, preserving shading rate acrossrestore_bindings, and subprocess-testing debug-layer safety (rs_set_shading_rate_x_forwards_without_debug_layer_errors) is very thorough.CIworkflow approved (running).Remaining before merge:
Build and testfinishing green plus AMD verification on30862ad.@Royalflamejlh on GitHub · 2026-11-25 02:09 UTC · original
Linux (Wine + vkd3d-proton) + NVIDIA test of
30862adon its base689f2dbwith #684 merged in: in 100 s of a retail title the#126stub was called 0 times with it (2 of 2 runs) and 1,446 to 1,662 times without (3 runs), and the screens were the same. One run on native Windows also made 0 calls of the stub.Setup: Fedora 44 (kernel 7.2.9), Wine 11.21 Staging, vkd3d-proton v3.1-90-g30b0eb9b, RTX 4070 12 GB (driver 615.71.09), Ryzen 9 9950X3D, 62 GB RAM; release, cross-compiled to
x86_64-pc-windows-gnu(rustc 1.98.0),XCL_PSO_PRELOAD=0. Windows: Windows 11 Pro 26300, RTX 5070 Ti 16 GB (driver 621.24), Ryzen 7 9800X3D, 32 GB RAM, rustc 1.99.1, release. Retail title 1.0.2.1, the first-run screens completed once and no story progress, A pressed on the account screen.Tested
30862ad(2 runs)ID3D12GraphicsCommandList10::#126 (not on PC)stub callsvariable shading rate (OPTIONS6)linetier 2, additional rates true689f2dbalone 2 h 45 min earlier logged 1,262 calls; it is not a pair.shading_ratetests, the three without a device passed under Wine; the debug-layer pair passed by skipping (SKIPPED … no InfoQueue), so no test checked the forward here.Read
list_x.rs:537(sanitize_shading_rate): each axis is clamped by itself, so0x2and0x8(1x4 and 4x1) pass unchanged with the additional rates, andD3D12_SHADING_RATEhas no such value. Does the console accept those two, and what does the PC do with them?Not tested: that each call reaches the PC's
RSSetShadingRate(the handler logs nothing per call); a 3D scene; which rate and combiners the title passes; an adapter without variable-rate shading; a matched pair on Windows; AMD and Intel.AI use: Claude Code (Claude Fable 5.2) read the diff, built the trees, ran the title and the tests, compared the frames and wrote this comment.
Posted without review by a person: the account owner was away and reads replies later.
@DavidM1911 on GitHub · 2026-11-25 02:50 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@JJAutoCompare on GitHub · 2026-11-25 02:55 UTC · original
PR #1944 compatibility verification
Commit
30862ad39c530455cd7c7072213b0a522d425b55Tested
DoublePrecisionFloatShaderOps=0, wave size 8–32). Rust1.100.0 (0ef1bc386 2026-11-09), DXC/DXIL1.9.2609.5, debug/test profiles with debug info disabled,XCL_ADAPTER=A770. The D3D12 debug-layer DLL is absent.cargo build --workspaceandcargo test --workspace --no-runsucceeded.cargo test -p xcl shading_rate -- --nocapturereported 5 passed, 0 failed, 0 ignored. The checks cover rate and combiner sanitization, a null command list, and wiring for console slots 124/126. The forwarding wrapper's short--exactfilter matched 0 tests, and the child returns immediately in an ordinary run.XCL_SHADING_RATE_DEBUG_CHILD=1under the Arc lock. It emittedSKIPPED … no InfoQueueand returned before recording any shading-rate command. This skip is outside the workspace totals. Workspace logs confirmed the OPTIONS6 probe reported VRS tier 2 with additional rates.cargo test --workspace --no-fail-fast -- --test-threads=4ran once under the shared Arc lock. Across 20 result blocks, libtest reported 955 passed, 25 failed, 45 ignored. The log contains 22SKIPPEDlines. Those lines include skipped subcases and do not count as coverage.0x80070057), four shader result mismatches (FMA, mip sampling, packed FP16, wave reduction), and one synthetic-title failure in dynamic depth bias (RSSetDepthBiasX).Not tested
Live CL5 shading-rate forwarding and restoration after command-list splits, the VRS-unsupported path on hardware, and other adapters. No retail-title smoke run or
mainbaseline was run, so the suite failures cannot be attributed to this PR from these results.AI use
T3 Code / Codex (
gpt-6.2-sol,reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity,gemini-4-neon) verified counts againstpr1944-suite.logand published this report.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.