fix(shader): accept clamp on VOP3 16-bit integer min, max and shifts #19337

Merged
al3w0f205 merged 2 commits from upstream-pr/19337 into main 2026-11-16 21:20:57 +00:00
al3w0f205 commented 2026-11-13 04:15:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by al3w0f205 on 2026-11-13T04:15:46Z.


What

Accept the VOP3 clamp modifier bit on 16-bit binary integer instructions (v_mul_lo_u16, v_lshrrev_b16, v_ashrrev_i16, v_max_u16, v_max_i16, v_min_u16, v_min_i16, v_lshlrev_b16) in checkNativeVop3Modifiers() without throwing std::invalid_argument.

Like their packed VOP3P integer counterparts (PR #19190), RDNA2 ignores the clamp bit on 16-bit integer operations. supportsNativeVop3Clamp(opcode) remains false for these opcodes, leaving destination clamp unset so execution semantics match hardware behavior.

Tested

  • Windows 11, NVIDIA GeForce RTX 4070 Laptop GPU, Vulkan 1.3.280 (driver 560.94)
  • Added Vop3Integer16Clamp.cpp covering 32 threads across all 8 instructions with clamp set: verified expected results across all lanes against hardware execution.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 4070 Laptop GPU, driver 560.94, Windows 11
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5289885748 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19337). Originally posted by [al3w0f205](https://github.com/al3w0f205) on 2026-11-13T04:15:46Z. --- ### What Accept the VOP3 clamp modifier bit on 16-bit binary integer instructions (`v_mul_lo_u16`, `v_lshrrev_b16`, `v_ashrrev_i16`, `v_max_u16`, `v_max_i16`, `v_min_u16`, `v_min_i16`, `v_lshlrev_b16`) in `checkNativeVop3Modifiers()` without throwing `std::invalid_argument`. Like their packed VOP3P integer counterparts (PR #19190), RDNA2 ignores the clamp bit on 16-bit integer operations. `supportsNativeVop3Clamp(opcode)` remains `false` for these opcodes, leaving destination clamp unset so execution semantics match hardware behavior. ### Tested - Windows 11, NVIDIA GeForce RTX 4070 Laptop GPU, Vulkan 1.3.280 (driver 560.94) - Added `Vop3Integer16Clamp.cpp` covering 32 threads across all 8 instructions with clamp set: verified expected results across all lanes against hardware execution. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 4070 Laptop GPU, driver 560.94, Windows 11 - [x] AI-assisted: yes
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
boykopovar/AnyPS5!19337
No description provided.