Skip to content

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

Open
davi713albano-coder wants to merge 1 commit into
fxceless:mainfrom
davi713albano-coder:shader/ps-coverage-input
Open

davi713albano-coder wants to merge 1 commit into
fxceless:mainfrom
davi713albano-coder:shader/ps-coverage-input

Conversation

@davi713albano-coder

Copy link
Copy Markdown

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.

@JRamos1993

Copy link
Copy Markdown

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.

@HAL9000RELOADED

Copy link
Copy Markdown

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 (comment)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants