Skip to content

shader: lower GFX10 xnor and swap ops - #146

Closed
Mesrine67 wants to merge 1 commit into
Marvisak:mainfrom
Mesrine67:fix/gfx10-xnor-swap
Closed

Mesrine67 wants to merge 1 commit into
Marvisak:mainfrom
Mesrine67:fix/gfx10-xnor-swap

Conversation

@Mesrine67

@Mesrine67 Mesrine67 commented Nov 24, 2026 •

Copy link
Copy Markdown

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.

@Mesrine67

Copy link
Copy Markdown
Author

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.

@Mesrine67 Mesrine67 closed this Nov 24, 2026
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.

1 participant