Repository navigation
D3D12.X: keep logic ops on pipelines whose render targets are all UINT - #2856
tiagonleal wants to merge 1 commit into
Conversation
sanitize_integer_rt_blend cleared LogicOpEnable together with BlendEnable on every integer render target. PC D3D12 forbids blending on UINT/SINT targets, but logic ops are the opposite case: they are valid only on UINT targets, need BlendEnable FALSE and IndependentBlendEnable FALSE (slot 0's state then applies to every bound target), and need D3D12_OPTIONS.OutputMergerLogicOp. A console pipeline that ORs or XORs bit masks into a UINT target therefore wrote plain overwrites on PC. With IndependentBlendEnable FALSE, slot 0 now keeps its logic op when every bound target is UINT and the device reports OutputMergerLogicOp (probed at device creation; without it the logic op is cleared as before and a warning is logged once). BlendEnable is still cleared. Any non-UINT target in the set (SINT, float, UNORM, UNKNOWN) drops the logic op, now also when no integer target is bound: such a pipeline is invalid on PC. The independent-blend path is unchanged. Tests: logic_op_stays_on_uint_render_targets (fails without the fix), logic_op_dropped_without_output_merger_logic_op (fails without the capability gate) and logic_op_dropped_unless_every_target_is_uint; the all-integer case of the existing sanitization test now uses a SINT target. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Independent desktop NVIDIA verification of PR #2856 at head Environment
Targeted release tests & build (
|
| Command | Result |
|---|---|
cargo test --release -p xcl --lib logic_op_dropped_without_output_merger_logic_op -- --nocapture |
1 passed; 0 failed; 0 ignored; 1344 filtered out (0.00s) |
cargo test --release -p xcl --lib logic_op_stays_on_uint_render_targets -- --nocapture |
1 passed; 0 failed; 0 ignored; 1344 filtered out (0.00s) |
cargo test --release -p xcl --lib logic_op_dropped_unless_every_target_is_uint -- --nocapture |
1 passed; 0 failed; 0 ignored; 1344 filtered out (0.00s) |
cargo test --release -p xcl --lib hle::d3d12x::real:: (3 consecutive runs) |
66 passed; 0 failed; 0 ignored; 1279 filtered out × 3 (0.35s, 0.36s, 0.36s) |
cargo build --release -p xcl --bin xcl |
Clean build (1m 09s, exit 0) |
Paired quiet 60 s retail smoke (title: 29640639)
Exact parent & merge-base (e120925e3abc9956a8b9bae631969d32e8ccd43c, cached baseline on the same machine):
xcl-smoke v1
commit: e120925e3abc9956a8b9bae631969d32e8ccd43c
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1602 (PresentX 1602)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13979 MB
PR #2856 (e29306f4b1e3dce921d03bef69c7c7f59ee441fd):
xcl-smoke v1
commit: e29306f4b1e3dce921d03bef69c7c7f59ee441fd
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1608 (PresentX 1608)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 13972 MB
Runtime log observations (xcl.log)
9223log lines,0[ERROR]/ device-removal / panic lines, and0OutputMergerLogicOplogic-op drop warnings.probe_logic_op(&device)ran cleanly during real RTX 4060 D3D12 device initialization.- Final draw/memory telemetry in log:
19561 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample13971 MB committed by the process; video memory 6115 MB local, 4650 MB non-local.
Limits of coverage
- The 60 s retail smoke on
title: 29640639exercises real RTX 4060 device initialization (probe_logic_op) and confirms zero regression across translated pipelines, draws, and dispatches, but the 60 s menu capture was not confirmed to create an active all-UINTLogicOpEnablepipeline on GPU (no on-GPU readback of a UINT bitwise logic-op render pass was run). Preservation on all-UINT render targets, dropping on SINT / mixed / non-UINT targets, and theD3D12_OPTIONS.OutputMergerLogicOpcapability gate were verified via the 3 new unit tests and 3× fullhle::d3d12x::real::runs (66/0/0).
AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
…xcl-dev#2856 triaged SKIP, probe past xcl-dev#2855)
sanitize_integer_rt_blendclearedLogicOpEnabletogether withBlendEnableon every integer render target. D3D12 on PC forbids blending on UINT and SINT targets, but logic ops are allowed on UINT targets, withBlendEnableFALSE andIndependentBlendEnableFALSE (slot 0's state then applies to every bound target). A console pipeline that ORs or XORs bit masks into a UINT target got plain overwrites on PC. The function came in with #1988, whose description gives no reason for clearing the logic op.With
IndependentBlendEnableFALSE, slot 0 now keeps its logic op when every bound target is UINT and the device reportsD3D12_OPTIONS.OutputMergerLogicOp.BlendEnableis still cleared. Without that capability the logic op is cleared as before and a warning is logged once. A logic op on a set with any non-UINT target (SINT, float, UNORM, UNKNOWN) is now cleared too, also when no integer target is bound, because D3D12 rejects such a pipeline. The independent-blend path is unchanged.Based on
e120925e, the lastmaincommit before #2555 (see Regression run).What is in it
crates/xcl/src/hle/d3d12x/real.rs:probe_logic_opcachesOutputMergerLogicOpat device creation;sanitize_integer_rt_blendtakeslogic_op_supportedand keeps the logic op on all-UINT target sets; newis_uint_dxgi_format; the four callers pass the cached valuelogic_op_stays_on_uint_render_targets,logic_op_dropped_without_output_merger_logic_opandlogic_op_dropped_unless_every_target_is_uint; the all-integer case ofinteger_rtv_blend_sanitization_clears_uint_sint_and_preserves_floatnow uses a SINT targetTested
cargo test -p xcl --lib pso_blend_and_tsharp_tests: 6 passed, 0 failed, 3 of 3 runs on e29306flogic_op_stays_on_uint_render_targets(real.rs:6732),logic_op_dropped_without_output_merger_logic_op(real.rs:6723) andlogic_op_dropped_unless_every_target_is_uint(real.rs:6770). The other three tests in the module pass.cargo test --workspace --no-fail-fast -- --test-threads=4, run twice on e29306f: 1441 passed, 4 failed, 47 ignored both times (25SKIPPEDlines: 21no wave64, 1no heap windows, 3 recompiler cases refused as unsupported). The 4 failures aregpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3(CreateComputePipelineStatereturns E_OUTOFMEMORY, 0x8007000E). They fail the same way one120925eon this machine (cargo test -p xcl --lib fuzz_validate_and_gpu: 0 passed, 4 failed).Regression run
scripts/smoke.ps1 -Seconds 60 -Title 9cc6a39e, default settings, release builds of both commits in clean trees,mainfirst, one run each.main(e120925):This PR:
NVIDIA profile for xcl.exe: shader heap 1024 MB
Both runs are on
e120925e, the lastmaincommit before #2555; I could not finish a first launch preparation on a commit that has it (stopped after 2 h 20 min at about 23,860 of 26,503 records on this machine), so the preparation added by #2555 is not covered.Not tested
OutputMergerLogicOpis covered by a unit test onlyIndependentBlendEnableTRUE are left as beforemaincommit that contains xcl run: prepare shaders in the game window before title execution #2555AI use
🤖 Generated with Claude Code