victory-shader: read pixel quad helper lanes without discard #2388

Open
bartikele wants to merge 1 commit from upstream-pr/2390 into main
bartikele commented 2026-11-25 12:33:55 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by bartikele on 2026-11-25T12:33:55Z.


Summary

  • Update Lower::helpers_read in crates/victory-shader/src/emit/lower.rs to return quad && self.s.pixel instead of gating on !self.x.st.discards.is_empty().
  • Even without discard, pixel shaders have helper lanes along triangle edges in 2x2 quads. Using waveReadLaneAt returns 0 for helper lanes on AMD, causing manual quad derivatives (ds_swizzle_b32 / dpp quad permutations) to blow up and pick the smallest mip level (producing visible lines along triangle edges on car paint, glass, and skin). Using quadReadLaneAt reads helper lanes in all pixel shaders.
  • Add unit test emit::tests::pixel_quad_swizzle_without_discard_uses_quad_reads.

Inspired by Belobug's VIctory-Belobug-AMD (

<!-- greyfinch-sync:Marvisak/VIctory:issue:6604575375 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2390). Originally posted by [bartikele](https://github.com/bartikele) on 2026-11-25T12:33:55Z. --- ## Summary - Update Lower::helpers_read in crates/victory-shader/src/emit/lower.rs to return quad && self.s.pixel instead of gating on !self.x.st.discards.is_empty(). - Even without discard, pixel shaders have helper lanes along triangle edges in 2x2 quads. Using waveReadLaneAt returns 0 for helper lanes on AMD, causing manual quad derivatives (ds_swizzle_b32 / dpp quad permutations) to blow up and pick the smallest mip level (producing visible lines along triangle edges on car paint, glass, and skin). Using quadReadLaneAt reads helper lanes in all pixel shaders. - Add unit test emit::tests::pixel_quad_swizzle_without_discard_uses_quad_reads. Inspired by Belobug's VIctory-Belobug-AMD (
catminou4 commented 2026-11-25 14:06:37 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T13:19:15Z.

Review: CHANGES_REQUESTED


Real compile break after merge into main 940d32f69b (cargo test -p victory-shader --locked, macOS arm64): error[E0425] cannot find function dump_dxil in this scope at crates/victory-shader/src/emit/mod.rs:1599 — dump_dxil is #[cfg(windows)] but the new caller is not. Gate the call (or the test using it) on Windows too. Will re-test after a push.

<!-- greyfinch-sync:Marvisak/VIctory:review:6058342821 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2390#pullrequestreview-6058342821). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T13:19:15Z. **Review:** CHANGES_REQUESTED --- Real compile break after merge into main 940d32f69b (`cargo test -p victory-shader --locked`, macOS arm64): error[E0425] `cannot find function dump_dxil in this scope` at crates/victory-shader/src/emit/mod.rs:1599 — dump_dxil is #[cfg(windows)] but the new caller is not. Gate the call (or the test using it) on Windows too. Will re-test after a push.
Marvisak commented 2026-11-25 15:04:34 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T14:59:54Z.


Automated triage for the maintainers.

This pull request no longer merges cleanly into main (conflicts in crates/victory-shader/src/emit/lower.rs). It will be reviewed once it is rebased onto the current main. The earlier verdict (merge-candidate) was for an older state of main.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7166140675 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2390#issuecomment-7166140675). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T14:59:54Z. --- <!-- victory-triage v1 head=6cce61872c408d62930bb0011b7e0e7032bdcea4 verdict=needs-rebase at=2026-11-25T16:03:20Z --> Automated triage for the maintainers. This pull request no longer merges cleanly into `main` (conflicts in `crates/victory-shader/src/emit/lower.rs`). It will be reviewed once it is rebased onto the current `main`. The earlier verdict (merge-candidate) was for an older state of `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2390:upstream-pr/2390'
git switch 'upstream-pr/2390'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/2390'
git switch 'upstream-pr/2390'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2390'
git switch 'upstream-pr/2390'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2390'
git switch 'main'
git merge --squash 'upstream-pr/2390'
git switch 'main'
git merge --ff-only 'upstream-pr/2390'
git switch 'main'
git merge 'upstream-pr/2390'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!2388
No description provided.