Skip to content

Shaders: 16-bit compares ignore VOP3 op_sel - #1043

Closed
Altorru wants to merge 2 commits into
Marvisak:mainfrom
Altorru:fix/cmp16-opsel
Closed

Altorru wants to merge 2 commits into
Marvisak:mainfrom
Altorru:fix/cmp16-opsel

Conversation

@Altorru

@Altorru Altorru commented Nov 24, 2026

Copy link
Copy Markdown

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 (Marvisak#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!
@shortselow-byte

Copy link
Copy Markdown

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:

@Zipettte

Copy link
Copy Markdown

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

@Marvisak

Copy link
Copy Markdown
Owner

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 Marvisak closed this Nov 25, 2026
fornorharry added a commit to NitricAcidDev/VIctory-Omega-Fork that referenced this pull request Nov 25, 2026
…er a read lock (Marvisak#1043, Marvisak#1068)

Marvisak#1043: a slot the pass mirrored was handed back to it as changed, so each
frame looked at 11,000 to 26,000 slots again (27 to 112 ms a frame in a
player's log on an RTX 5080). Also flags that say which sets a slot may be
in, and one lock a page of records. Kept from this branch: views that could
not be made are tried again at growing distances, and memory under a
table's texture stays tracked.
Marvisak#1068: the copies of title buffers are found under a read lock; the spans of
a pass go in under one lock.

The primary merge lost the line that records a view as made, so every slot
would have been made again at each read: put back here. Found while this
was merged; no build had it.

Primary's test for a descriptor's words from a load of another width, which
the merge left out, is in lower_tests.rs.

AI-assisted. Not run with the title.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

5 participants