Shaders: lower v_xnor_b32 and v_swap_b32 #58

Manually merged
github merged 1 commit from gh-pr/58/head into gh-pr/58/base 2026-11-26 03:48:44 +00:00
Owner

@⁠Yaekai on GitHub · 2026-11-23 23:59 UTC · original
Yaekai:feat/shader-xnor-swap → main · +34 −2 · 2 files · 1 commits · merged 2026-11-24 00:35 UTC

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.
**@⁠Yaekai** on GitHub · 2026-11-23 23:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/58) `Yaekai:feat/shader-xnor-swap` → `main` · +34 −2 · 2 files · 1 commits · merged 2026-11-24 00:35 UTC 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:48:42 +00:00
github manually merged commit 0c560918b3 into gh-pr/58/base 2026-11-26 03:48:44 +00:00
Author
Owner

@⁠DaviTostes on GitHub · 2026-11-24 00:02 UTC · original

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 #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).

**@⁠DaviTostes** on GitHub · 2026-11-24 00:02 UTC · [original](https://github.com/Marvisak/VIctory/pull/58#issuecomment-7117645536) 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 #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).
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!58
No description provided.