Skip to content

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

Open
bartikele wants to merge 1 commit into
Marvisak:mainfrom
bartikele:shader-pixel-quad-helpers
Open

bartikele wants to merge 1 commit into
Marvisak:mainfrom
bartikele:shader-pixel-quad-helpers

Conversation

@bartikele

Copy link
Copy Markdown
Contributor

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 (

@bartikele
bartikele force-pushed the shader-pixel-quad-helpers branch from 3319893 to 4b21263 Compare November 25, 2026 12:47
@bartikele
bartikele force-pushed the shader-pixel-quad-helpers branch from 4b21263 to 6cce618 Compare November 25, 2026 12:53

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Real compile break after merge into main 940d32f (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 Nov 25, 2026 •

Copy link
Copy Markdown
Owner

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants