Skip to content

Shaders: lower v_xnor_b32 and v_swap_b32 - #58

Merged
Marvisak merged 1 commit into
Marvisak:mainfrom
Yaekai:feat/shader-xnor-swap
Nov 24, 2026
Merged

Marvisak merged 1 commit into
Marvisak:mainfrom
Yaekai:feat/shader-xnor-swap

Conversation

@Yaekai

@Yaekai Yaekai commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Adds lowering for two VALU instructions encountered in GTA VI world compute shaders:

  • v_xnor_b32 in crates/victory-shader/src/emit/lower.rs
  • v_swap_b32 in crates/victory-shader/src/emit/lower.rs, plus recording v.dst as a read in crates/victory-shader/src/ir.rs for v_swap_b32 / v_swaprel_b32 since both operands are read before being swapped.

Verification

  • cargo test -p victory-shader: 57/57 passed.
  • Verified live in GTA VI world run: both world shaders that previously dropped with v_xnor_b32 is not supported / v_swap_b32 is not supported now translate cleanly.

Add lowering for v_xnor_b32 and v_swap_b32 (seen in GTA VI world compute shaders), and record v.dst as a read in ir.rs for v_swap_b32 / v_swaprel_b32 since both operands are read before being swapped.
@DaviTostes

Copy link
Copy Markdown

Tested 0c56091 stacked on #39 on Arch Linux x86_64, rustc 1.98.1: pass.

  • main alone does not build on Linux (E0425 in victory-gpu), so the check uses Build: make workspace tests run on Linux #39 as the base; the merge is clean.
  • cargo test --workspace: 156 passed, 0 failed, 3 ignored, so the two new lowering paths do not disturb the existing shader tests.
  • No game data used.

One review note: the diff adds no test for v_xnor_b32 / v_swap_b32 themselves (lower.rs + ir.rs only), so this run is a no-regression check rather than coverage of the new lowering — worth a synthetic case like the neighbouring VALU tests.

AI-assisted (DeepSeek V4.1 Flash coding agent).

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