Shaders: backport the scalar-code bounds fix from Vice-Tay #1495

Merged
t90 merged 1 commit from upstream-pr/1495 into main 2026-11-28 01:48:22 +00:00
t90 commented 2026-11-27 19:37:28 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by t90 on 2026-11-27T19:37:28Z.


A VOP3 instruction can expose a scalar destination code above 127 while unspill scans register effects. The current 128-entry used table panics (reproduced at index 215) before translation can return its normal result or error. Cover all 256 scalar codes, matching the neighbouring tables.

Backport of Vice-Tay 00eaf47 by illuminatedfellow, originally from avatarmanz/VIctory-7900XTX#325. The synthetic regression covers wave32 and wave64 inputs. This PR changes only ir.rs.

Validation on the local source, verified identical to the uploaded file:

  • Regression fails on the old table: index 215, length 128.
  • All 11 IR tests pass with the fix.
  • Shader all-targets Clippy passes with default and all features, warnings denied.
  • Whole-workspace Clippy stops on the existing precedence warning in victory-formats/src/texture.rs:1346 (already addressed by other open PRs); that unrelated file is unchanged.
  • Full local shader library: 292 passed, 4 ignored. Other non-GPU workspace packages passed; the two HLE loopback/hard-link cases blocked by sandbox permissions passed when rerun outside it.
  • Asset-policy tests passed. The local test base was f299fba; the public branch also includes upstream cd93552, whose water changes are unrelated to this file.
  • The full victory-gpu suite was not run for this shader-only patch. No in-game FPS or visual-quality improvement is claimed.

Only source and synthetic test instructions are included; no game files, dumps or extracted data. Prepared with AI assistance.

<!-- greyfinch-sync:fxceless/victory-fork:issue:5532151125 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1495). Originally posted by [t90](https://github.com/t90) on 2026-11-27T19:37:28Z. --- A VOP3 instruction can expose a scalar destination code above 127 while `unspill` scans register effects. The current 128-entry `used` table panics (reproduced at index 215) before translation can return its normal result or error. Cover all 256 scalar codes, matching the neighbouring tables. Backport of [Vice-Tay 00eaf47](https://github.com/TaynanGT/Vice-Tay/commit/00eaf47c77431830c0342bb87f88de8bf2e4fb06) by illuminatedfellow, originally from avatarmanz/VIctory-7900XTX#325. The synthetic regression covers wave32 and wave64 inputs. This PR changes only `ir.rs`. Validation on the local source, verified identical to the uploaded file: - Regression fails on the old table: index 215, length 128. - All 11 IR tests pass with the fix. - Shader all-targets Clippy passes with default and all features, warnings denied. - Whole-workspace Clippy stops on the existing precedence warning in `victory-formats/src/texture.rs:1346` (already addressed by other open PRs); that unrelated file is unchanged. - Full local shader library: 292 passed, 4 ignored. Other non-GPU workspace packages passed; the two HLE loopback/hard-link cases blocked by sandbox permissions passed when rerun outside it. - Asset-policy tests passed. The local test base was `f299fba`; the public branch also includes upstream `cd93552`, whose water changes are unrelated to this file. - The full victory-gpu suite was not run for this shader-only patch. No in-game FPS or visual-quality improvement is claimed. Only source and synthetic test instructions are included; no game files, dumps or extracted data. Prepared with AI assistance.
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
fxceless/victory-fork!1495
No description provided.