Direct DXIL: write PS exp mrtz sample mask to SV_Coverage #2358
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!2358
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2358"
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?
@safesearch77 on GitHub · 2026-11-25 16:30 UTC · original
safesearch77:fix/dxil-ps-mrtz-sv-coverage→main· +286 −49 · 2 files · 1 commits · draftPort
6dbae61(Recompiler: a PS sample mask from exp mrtz is written to SV_Coverage) to the Direct DXIL pixel-shader backend (crates/xcl/src/gpu/dxil/lower_gfx.rs) soXCL_DIRECT_DXIL=allpreserves custom pixel sample masks and matches the HLSL recompiler'sOSG1signature.Part of #1269
What is in it
crates/xcl/src/gpu/dxil/lower_gfx.rs:0xFFFF_FFFF-initialised sample-mask temporary whenPsInterface::outputsdeclaresSV_Coverage(system_value == 66).comp(self, 2)inexport_gfx(tgt == 8, coveringVSRC2for 32-bit Z exports withEN & 0x4 != 0andVSRC1[15:0]for compressedUINT16_ABGRexports withCOMPR = 1, EN & 0xC != 0) and recordps_writes_mask.OSG1outputs infinish_gfxinps.outputsorder, emittingSV_Coverageiffps_writes_maskholds and skipping the dummySV_Target7fallback on coverage-only pixel shaders.crates/xcl/src/gpu/dxil/graphics_tests.rs:ps_mrtz_sample_mask_writes_sv_coverage: verifiesOSG1declarations, emittedDXILbitcode parsing, anddx.op.storeOutput.i32IR value provenance across uncompressedEN = 0x4, compressedCOMPR = 1, EN = 0xCunder a lane-divergentEXEC+S_CBRANCH_EXECZbypassphi, depth-onlyEN = 0x1withSV_Coveragein signature, coverage-only PS without dummySV_Target7, andmrtzmask export withoutSV_Coveragein signature.Tested
rustc --edition 2021 --testharness overgpu::dxil::graphics::tests, base0829441, head517a26d): verifiedps_mrtz_sample_mask_writes_sv_coveragefails (0 passed; 1 failed) againstmainlower_gfx.rsand passes (9 passed; 0 failedacross allgraphics::tests) with the fix applied.cargo check --offline --target x86_64-pc-windows-gnu --workspace --tests(0errors,0new warnings).Not tested
cargo test --workspace -- --test-threads=4GPU suite (dxcompiler.dllvalidation) and paired Windowsscripts/smoke.ps1runs (opened as Draft from Linux; note Direct DXIL pixel shaders requireXCL_DIRECT_DXIL=all).AI use
6dbae61Direct-DXIL parity gap, implemented the fix and 5-case unit test, and verified RED-to-GREEN execution on host CPU; reviewed with Claude Opus 5.5.@DavidM1911 on GitHub · 2026-11-25 18:37 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!
@SlopTart on GitHub · 2026-11-25 19:06 UTC · original
Tested: current PR head merged onto current
origin/main(clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo targetx86_64-pc-windows-gnurun under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).suite: 144/3 = the three known baseline failures on this lane (
fuzz_validate_and_gpu_2seed 1003,gpu_nonfused_mad_and_mac_prevent_fma_contraction,gpu_depth_buffer_created_for_unordered_access_is_placed). Targeted run of the newps_mrtz_sample_masktest: 2 passed.Not tested: retail titles (no title data on this lane, counts only).
AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.