Shaders: lower pixel shader SV_Coverage input via dx.op.coverage #1686
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1686
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@Calvix2k on GitHub · 2026-11-24 20:45 UTC · original
Calvix2k:codex/shader-ps-coverage-1530→main· +177 −0 · 3 files · 2 commits · openImplements #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).@Calvix2k on GitHub · 2026-11-24 21:39 UTC · original
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.@Calvix2k on GitHub · 2026-11-24 22:15 UTC · original
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.@upipibi on GitHub · 2026-11-24 22:52 UTC · original
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.
@Marvisak on GitHub · 2026-11-25 03:33 UTC · original · edited 2026-11-25 22:24 UTC
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
@StExpeditus on GitHub · 2026-11-25 09:16 UTC · original
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.@Calvix2k on GitHub · 2026-11-25 10:14 UTC · original
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.16ce8f33c5to0bbde516e7@catminou4 on GitHub · 2026-11-24 21:40 UTC · original · approved these changes
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.
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.