Shaders: 16-bit compares ignore VOP3 op_sel #1043

Closed
github-bot wants to merge 2 commits from gh-pr/1043/head into gh-pr/1043/base
Owner

@⁠Altorru on GitHub · 2026-11-24 15:15 UTC · original
Altorru:fix/cmp16-opsel → main · +158 −20 · 5 files · 2 commits · closed without merging

Sync from Altorru fork

**@⁠Altorru** on GitHub · 2026-11-24 15:15 UTC · [original](https://github.com/Marvisak/VIctory/pull/1043) `Altorru:fix/cmp16-opsel` → `main` · +158 −20 · 5 files · 2 commits · closed without merging Sync from Altorru fork
RDNA2 reads only the low half in v_cmp_*/v_cmpx_* over f16, u16 and i16,
whatever op_sel says; VIctory honoured it and compared the wrong half. The
arithmetic paths still honour op_sel. Adds a test for the f16 and u16
compares with op_sel set and clear (#833).
- Add hex = "0.4" crate dependency to victory-loader
- Replace custom hexDecode() with hex::decode()
- Add parse_victory_patch() and apply_victory_patches() functions
- Support format: <module>:<rva hex>:<hex bytes>
- Log patch applications via tracing::info!
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:18:09 +00:00
github-bot closed this pull request 2026-11-26 04:18:09 +00:00
Author
Owner

@⁠shortselow-byte on GitHub · 2026-11-24 15:51 UTC · original

This PR has no CI run yet, so I ran the CI's checks at head f23c493 (on main ffe310e): Windows 11, Rust 1.98.1 MSVC, AMD Radeon RX 6900 XT (RDNA2).

  • cargo test --workspace --locked -- --test-threads=1: 343 passed, 0 failed, including v_cmp_16bit_ignores_vop3_op_sel (AMD device and WARP).
  • cargo clippy --workspace --all-targets --locked -- -D warnings fails, from the second commit (VICTORY_PATCH: refine hex crate support), not the compare change:
error: this let-binding has unit value
   --> crates\victory-loader\src\prepare.rs:217:9
    |
217 |         let _ = bytes[*rva as usize..*rva as usize + new_bytes.len()].copy_from_slice(new_bytes);

Two notes:

  • That commit (victory-loader/src/prepare.rs, a new dependency in Cargo.lock) is unrelated to the title and has no description; it probably belongs in its own PR.
  • The compare change overlaps #926, which makes the same fix (16-bit compares ignore VOP3 op_sel, v_cmp_class left alone) and is already reviewed and approved.
**@⁠shortselow-byte** on GitHub · 2026-11-24 15:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/1043#issuecomment-7136736263) This PR has no CI run yet, so I ran the CI's checks at head `f23c493` (on `main` `ffe310e`): Windows 11, Rust 1.98.1 MSVC, AMD Radeon RX 6900 XT (RDNA2). - `cargo test --workspace --locked -- --test-threads=1`: 343 passed, 0 failed, including `v_cmp_16bit_ignores_vop3_op_sel` (AMD device and WARP). - `cargo clippy --workspace --all-targets --locked -- -D warnings` fails, from the second commit (`VICTORY_PATCH: refine hex crate support`), not the compare change: ``` error: this let-binding has unit value --> crates\victory-loader\src\prepare.rs:217:9 | 217 | let _ = bytes[*rva as usize..*rva as usize + new_bytes.len()].copy_from_slice(new_bytes); ``` Two notes: - That commit (`victory-loader/src/prepare.rs`, a new dependency in `Cargo.lock`) is unrelated to the title and has no description; it probably belongs in its own PR. - The compare change overlaps #926, which makes the same fix (16-bit compares ignore VOP3 `op_sel`, `v_cmp_class` left alone) and is already reviewed and approved.
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 16:30 UTC · original

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at f23c493: cargo test -p victory-loader -p victory-shader passes, 146 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

**@⁠Zipettte** on GitHub · 2026-11-24 16:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/1043#issuecomment-7137770310) Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at f23c493: `cargo test -p victory-loader -p victory-shader` passes, 146 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:31 UTC · original

Automated triage for the maintainers. Closing because another open pull request covers the same change.

See #926. 'Sync from fork': besides the op_sel change of #926 it adds an undisclosed VICTORY_PATCH that rewrites title image bytes in every build (uses the RVA as a file offset, panics past the end) and a new hex dependency, plus reformatting.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 00:31 UTC · [original](https://github.com/Marvisak/VIctory/pull/1043#issuecomment-7148588559) Automated triage for the maintainers. Closing because another open pull request covers the same change. See #926. 'Sync from fork': besides the op_sel change of #926 it adds an undisclosed VICTORY_PATCH that rewrites title image bytes in every build (uses the RVA as a file offset, panics past the end) and a new `hex` dependency, plus reformatting. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

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