shader: lower GFX10 xnor and swap ops #146

Closed
Mesrine67 wants to merge 1 commit from upstream-pr/146 into main
Mesrine67 commented 2026-11-24 00:57:46 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Mesrine67 on 2026-11-24T00:57:46Z.


The GTA VI Xbox build 1.0.2.1 shader archive contains v_xnor_b32 and v_swap_b32, but the lowerer did not support them. This patch lowers v_xnor_b32 as a bitwise complement of XOR and v_swap_b32 as an exchange of the source and destination VGPR values for each active lane. It rejects modifiers that the instruction does not support.

Validation:

  • cargo test -p victory-shader — 57 passed.
  • cargo clippy -p victory-shader -- -D warnings — passed.
  • rustfmt --edition 2024 --check crates/victory-shader/src/emit/lower.rs — passed.
  • Offline translation and Windows SDK DXIL validation on the local build 1.0.2.1 shaders.rpf: 22,156 emitted and 21,971 validated. The previous recorded baseline was 22,148 emitted and 21,963 validated. No D3D12 GPU pipelines or game executable were run.
  • Workspace-wide cargo fmt --check reports formatting diffs in other unchanged files; the focused check for the modified file passes.
<!-- greyfinch-sync:Marvisak/VIctory:issue:6572141074 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/146). Originally posted by [Mesrine67](https://github.com/Mesrine67) on 2026-11-24T00:57:46Z. --- The GTA VI Xbox build 1.0.2.1 shader archive contains `v_xnor_b32` and `v_swap_b32`, but the lowerer did not support them. This patch lowers `v_xnor_b32` as a bitwise complement of XOR and `v_swap_b32` as an exchange of the source and destination VGPR values for each active lane. It rejects modifiers that the instruction does not support. Validation: - `cargo test -p victory-shader` — 57 passed. - `cargo clippy -p victory-shader -- -D warnings` — passed. - `rustfmt --edition 2024 --check crates/victory-shader/src/emit/lower.rs` — passed. - Offline translation and Windows SDK DXIL validation on the local build 1.0.2.1 `shaders.rpf`: 22,156 emitted and 21,971 validated. The previous recorded baseline was 22,148 emitted and 21,963 validated. No D3D12 GPU pipelines or game executable were run. - Workspace-wide `cargo fmt --check` reports formatting diffs in other unchanged files; the focused check for the modified file passes.
upstream-sync closed this pull request 2026-11-24 06:51:30 +00:00
Mesrine67 commented 2026-11-24 06:54:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Mesrine67 on 2026-11-24T01:02:37Z.


This PR is superseded by upstream PR #58, which already merged v_xnor_b32 and v_swap_b32 lowering. I opened this while my local upstream/main was still at 062ad14; the subsequent fetch brought in the existing implementation. Closing to avoid a duplicate contribution.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7118694560 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/146#issuecomment-7118694560). Originally posted by [Mesrine67](https://github.com/Mesrine67) on 2026-11-24T01:02:37Z. --- This PR is superseded by upstream PR #58, which already merged `v_xnor_b32` and `v_swap_b32` lowering. I opened this while my local `upstream/main` was still at 062ad14; the subsequent fetch brought in the existing implementation. Closing to avoid a duplicate contribution.

Pull request closed

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!146
No description provided.