Shaders: lower pixel shader SV_Coverage input via dx.op.coverage #1685
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1686"
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?
Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-24T20:45:11Z.
Implements #1530.
Ports the fix from @davi713albano-coder's fork (commit c0f6d69 by Davi713), applied unchanged onto
ffe310e; the commit keeps its original author.Summary
io::raisealready liftedSPI_PS_INPUT_ADDRbit 14 toInput::SampleCoverage, butemit::lowerrefused it as "a pixel system input".Input::SampleCoveragenow lowers to DXILdx.op.coverage.i32(opcode 91,ReadNone).SV_Coverage(kind == 14) is stripped from the pixelISG1before emission when a console container lists it there, since DXIL declares itNotInSigfor pixel inputs.Test
New synthetic pixel-shader test
ps_sample_coverage_input_reads_coverage_mask: SPI input bit 14,ISG1stripping, dxil.dll validation and container hash, plus a live D3D12 draw readback on a 1x target asserting the covered pixel reads the full mask.Validation
cargo test -p victory-shader --locked -- --test-threads=1 --skip emit::valu_tests --skip emit::waterfall_tests— passed (102 tests, 1 ignored).cargo clippy -p victory-shader --all-targets --all-features --locked -- -D warnings— passed.cargo xtask policy— passed (154 files).Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T21:40:09Z.
Review: APPROVED
Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (
ffe310e), cargo test -p victory-shader --locked → 96 passed, 0 failed. Hardware/valu/waterfall execution tests are #[cfg(all(test, windows))] and run only on Windows; macOS covers lowering/structure unit tests.PS SV_Coverage input lowered via dx.op.coverage: ps_sample_coverage_input_reads_coverage_mask renders and checks the coverage mask per sample.
Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-24T21:39:46Z.
Hardware run on head of this PR, AMD RDNA3:
cargo test -p victory-shader --locked ps_sample_coverage_input_reads_coverage_mask -- --test-threads=1 --nocapture— 1 passed, 0 failed on the hardware backend (the 1x coverage readback is correct). WARP skipped at SM 6.2 here.Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-24T22:15:02Z.
Rebased onto
70564ae. Conflicts were in the test module only: upstream added its own tests/helpers, andHostShadergained six fields (root_uavs,memory,memory_writes,view_addresses,heap,heap_writes). The test's VS literal now fills them with empty/false; cargo check -p victory-shader --tests passes.Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-24T22:52:00Z.
NVIDIA run: RTX 3070 8 GB, driver 616.56, Windows 11, debug,
14ca121(onmain70564ae).ps_sample_coverage_input_reads_coverage_maskpasses on the hardware adapter.AI-assisted (Claude Code). Synthetic tests only.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T03:33:37Z.
Automated triage for the maintainers.
Needs rebase. This PR no longer merges cleanly into
main:mainhas moved since the last triage, and the branch now conflicts incrates/victory-shader/src/emit/valu_tests.rs. It will be reviewed again once it is rebased onto currentmain.Previous verdict for this head: merge candidate.
Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by StExpeditus on 2026-11-25T09:16:05Z.
Test report: RTX 5060 Ti (Blackwell), Windows 11 Pro 26200, driver 621.24. Branch at
16ce8f3.cargo test --workspace --locked --no-fail-fast-> 697 passed, 5 failed, 10 ignored. The failures are the same 5 pre-existing NVIDIA 1M-view-heap-cap failures (also on main; see my reports on #2030 and #1940). Nothing introduced by this PR fails on this machine.Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-25T10:14:51Z.
Hardware run on an RX 7800 XT (RDNA3), Windows 10 19045, SM 6.6 through the Agility runtime staged for the test binaries (#486): the whole
victory-shaderlib suite — 248 passed, 0 failed, 3 ignored — including the coverage lowering and its pixel readback. So thedx.op.coveragepath is exercised on the card here, not only on CI's device.Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T14:40:06Z.
The red check on
0bbde51stops at Clippy becauseps_sample_coverage_input_reads_coverage_maskis missing its#[test]attribute. Commit3a71a1fadds that one line and fast-forwards this exact PR head.I ran the same draw fixture on current
main(63bcca4) and the follow-up. Main refuses to emita pixel system input. The follow-up validates with DXIL 1.9.2609.5 and reads back four pixels with coverage mask 1 on app-local WARP 1.0.22. All 36 VALU tests passed, along with strict shader Clippy and the asset policy.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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.