Shaders: lower pixel shader SV_Coverage input via dx.op.coverage #657

Open
github-bot wants to merge 1 commit from github-bot/gh-657 into main AGit
Owner

@⁠davi713albano-coder on GitHub · 2026-11-25 04:08 UTC · original
davi713albano-coder:shader/ps-coverage-input → main · +174 −0 · 3 files · 1 commits · open

Summary

  • Lower Input::SampleCoverage (SPI_PS_INPUT_ADDR bit 14) in crates/victory-shader/src/emit/lower.rs via dx.op.coverage.i32 (opcode 91, Attr::ReadNone), instead of falling through to Val::Missing.
  • Strip SV_Coverage (kind == 14, NotInSig in DXIL) from pixel shader ISG1 in crates/victory-shader/src/emit/mod.rs if a console container lists it there.
  • Add synthetic D3D12 test ps_sample_coverage_input_reads_coverage_mask in crates/victory-shader/src/emit/valu_tests.rs verifying DXIL validation, container hash, graphics pipeline creation, and Host::draw readback (coverage mask 1 on a 1x target).

Verification

  • Verified cargo clippy --workspace --all-targets --locked -- -D warnings, --all-features, and cargo test --workspace --locked on windows-latest (ps_sample_coverage_input_reads_coverage_mask passes DXIL validation and D3D12 draw readback).

No title data used. AI-assisted.

**@⁠davi713albano-coder** on GitHub · 2026-11-25 04:08 UTC · [original](https://github.com/fxceless/victory-fork/pull/657) `davi713albano-coder:shader/ps-coverage-input` → `main` · +174 −0 · 3 files · 1 commits · open ### Summary - Lower `Input::SampleCoverage` (`SPI_PS_INPUT_ADDR` bit 14) in `crates/victory-shader/src/emit/lower.rs` via `dx.op.coverage.i32` (opcode `91`, `Attr::ReadNone`), instead of falling through to `Val::Missing`. - Strip `SV_Coverage` (`kind == 14`, `NotInSig` in DXIL) from pixel shader `ISG1` in `crates/victory-shader/src/emit/mod.rs` if a console container lists it there. - Add synthetic D3D12 test `ps_sample_coverage_input_reads_coverage_mask` in `crates/victory-shader/src/emit/valu_tests.rs` verifying DXIL validation, container hash, graphics pipeline creation, and `Host::draw` readback (coverage mask `1` on a 1x target). ### Verification - Verified `cargo clippy --workspace --all-targets --locked -- -D warnings`, `--all-features`, and `cargo test --workspace --locked` on `windows-latest` (`ps_sample_coverage_input_reads_coverage_mask` passes DXIL validation and D3D12 draw readback). No title data used. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:48:22 +00:00
Author
Owner

@⁠JRamos1993 on GitHub · 2026-11-25 05:27 UTC · original

Offline check on the retail shader pack: no program of the title reaches this path. The change is neutral for it.

victory translate --validate --list over the title's full shader pack (26,084 programs) on an RTX 5090, main 310c6eb against this head merged onto it:

  • Validated: 25,382 in both, none lost.
  • DXIL: with a local hash on each validated line, 0 programs' DXIL differs (two runs of one build hash the same; the hash catches real changes).
  • Failures: none of the 507 failing programs on main fails on pixel shaders reading SV_Coverage.

So this fix doesn't change anything for this title's shaders as the batch tool translates them. It may still matter for other programs or titles.

AI use: Claude Code with Claude Opus 5.5 ran the pack and wrote this. Nothing from the title is in it.

**@⁠JRamos1993** on GitHub · 2026-11-25 05:27 UTC · [original](https://github.com/fxceless/victory-fork/pull/657#issuecomment-7153793268) **Offline check on the retail shader pack: no program of the title reaches this path. The change is neutral for it.** `victory translate --validate --list` over the title's full shader pack (26,084 programs) on an RTX 5090, `main` `310c6eb` against this head merged onto it: - **Validated:** 25,382 in both, none lost. - **DXIL:** with a local hash on each validated line, **0 programs' DXIL differs** (two runs of one build hash the same; the hash catches real changes). - **Failures:** none of the 507 failing programs on `main` fails on pixel shaders reading `SV_Coverage`. So this fix doesn't change anything for this title's shaders as the batch tool translates them. It may still matter for other programs or titles. AI use: Claude Code with Claude Opus 5.5 ran the pack and wrote this. Nothing from the title is in it.
Author
Owner

@⁠HAL9000RELOADED on GitHub · 2026-11-25 19:29 UTC · original

RX 7900 XTX (RDNA3), Windows 10 + #402 for SM 6.6, main d510ee4: the new test ps_sample_coverage_input_reads_coverage_mask passes on the card with this PR, and fails with the test alone on the base. No other test changed. Run table: #129 (#129).

**@⁠HAL9000RELOADED** on GitHub · 2026-11-25 19:29 UTC · [original](https://github.com/fxceless/victory-fork/pull/657#issuecomment-7172378336) RX 7900 XTX (RDNA3), Windows 10 + #402 for SM 6.6, main `d510ee4`: the new test `ps_sample_coverage_input_reads_coverage_mask` passes on the card with this PR, and fails with the test alone on the base. No other test changed. Run table: #129 (https://git.gtahub.st/github/fxceless--victory-fork/pulls/129).
This pull request has changes conflicting with the target branch.
  • crates/victory-shader/src/emit/valu_tests.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/657/head:github-bot/gh-657'
git switch 'github-bot/gh-657'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-657'
git switch 'github-bot/gh-657'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-657'
git switch 'github-bot/gh-657'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-657'
git switch 'main'
git merge --squash 'github-bot/gh-657'
git switch 'main'
git merge --ff-only 'github-bot/gh-657'
git switch 'main'
git merge 'github-bot/gh-657'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.