Shaders: lower pixel SV_Coverage input via dx.op.coverage #1886
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!1886
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1886/head"
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?
@n-romanovich on GitHub · 2026-11-25 00:04 UTC · original
n-romanovich:fix/shader-ps-coverage→main· +42 −0 · 2 files · 1 commits · closed without mergingFixes #1530
Problem
io::raisealready liftsSPI_PS_INPUT_ADDRbit 14 (sample_coverage) intoInput::SampleCoverage, andiorecognizes semantic kind14, butemit::lower::inputfell through toVal::Missing("a pixel system input"). In addition, console containers can listSV_Coverage(kind == 14) inISG1, whereas DXIL expects pixelSV_Coverageinputs to beNotInSigand read viadx.op.coverage.Fix
crates/victory-shader/src/emit/lower.rs: handleInput::SampleCoverageinLower::inputby emittingdx.op.coverage.i32(opcode91,Attr::ReadNone, no extra arguments) in the entry block.crates/victory-shader/src/emit/mod.rs: strip signature elements withkind == 14from pixelISG1(and the derivedPSV0input signature) inemit.crates/victory-shader/src/emit/mod.rs: addemit::tests::pixel_sample_coverage_input_lowers_and_drops_from_isg1to verify translation andISG1stripping on a synthetic pixel shader readingSPI_PS_INPUT_ADDRbit 14.Verification
cargo test -p victory-shader --locked -- pixel_sample_coverage_input_lowers_and_drops_from_isg1on Windows 11 (NVIDIA RTX 5060 Ti): 1 passed, 0 failed.@Marvisak on GitHub · 2026-11-25 08:19 UTC · original
Automated triage for the maintainers.
Merge candidate.
io::raiseon main already mapsSPI_PS_INPUT_ADDRbit 14 toInput::SampleCoverage, butLower::input(crates/victory-shader/src/emit/lower.rs) refused it as "a pixel system input". This PR reads it withdx.op.coverage.i32(opcode 91, ReadNone) in the entry block. Inemit(emit/mod.rs) it also drops pixel signature elements of kind 14, which is DXIL's Coverage semantic kind and matches how this file already uses 13 for IsFrontFace and 16 for Target, because DXIL does not put SV_Coverage in the input signature. I checked that the test helperemit_pixelruns the module throughdxil.dllwhen one is present, so the new test also validates the coverage read, not only the empty ISG1.Notes:
CI: no check runs on this head. The author reports the new test passing on Windows (RTX 5060 Ti).
Generated by Claude Code
@sinan-cmyk on GitHub · 2026-11-25 11:46 UTC · original
Offline measurement on a retail dump
Result: no count change against
main.I merged head
77329c18ontomain940d32f(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs). Validated: 23,918 onmain, 23,918 with this PR.No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right.
No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
@Marvisak on GitHub · 2026-11-25 22:03 UTC · original
Automated triage for the maintainers, second look (a review against current
main, with builds and tests where they could change the verdict).Closing as a duplicate of #1686, which makes the identical change in
Lower::inputandemit_withand adds a GPU draw-and-readback test of the value. The two conflict on the same lines. The change itself is right.If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.
Pull request closed