Shaders: lower v_xnor_b32 and v_swap_b32 #58

Merged
Yaekai merged 1 commit from upstream-pr/58 into main 2026-11-24 00:35:32 +00:00
Yaekai commented 2026-11-23 23:59:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Yaekai on 2026-11-23T23:59:22Z.


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.
<!-- greyfinch-sync:Marvisak/VIctory:issue:6571411174 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/58). Originally posted by [Yaekai](https://github.com/Yaekai) on 2026-11-23T23:59:22Z. --- 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.
upstream-sync closed this pull request 2026-11-24 06:51:07 +00:00
DaviTostes commented 2026-11-24 06:54:34 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-24T00:02:55Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7117645536 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/58#issuecomment-7117645536). Originally posted by [DaviTostes](https://github.com/DaviTostes) on 2026-11-24T00:02:55Z. --- 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).
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!58
No description provided.