GPU, HLE, loader and shader: 14 bug fixes that apply cleanly to main #460

Open
zocram4cc wants to merge 14 commits from upstream-pr/460 into main
zocram4cc commented 2026-11-27 12:36:43 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by zocram4cc on 2026-11-27T12:36:43Z.


Fourteen bug fixes cherry-picked from a third-party Proton/RADV port (zocram4cc/victory-linux-perf, main) onto 126acb35. They apply cleanly one by one; original authors and commit messages are kept.

What they are: GPU stability (query heap, CPU snapshot retry, 4 KiB texture alignment, APU heap use-after-free, command-queue release use-after-free, DirectStorage out-pointer, loader DLL case and clzero-loop decoding, gamepad output), plus five shader fixes (helper-lane v_readfirstlane, always-true/false float compares, gfx10 _g16 gradient packing, an AMD compiler crash, a pos4 export).

Authors: davutsimsekk, avt0m4t, AscilCH (×3), Peppacodes (×2), Vax, mynzjerko, libslibslibslibslibslibs.

Provenance: curated from the RYUKI-7900XT / LibsMQG hle-d3d12-7900xtx fork line and contributor PRs; none of the fourteen is in main or in any open PR I could find (checked the open list against each commit).

One default-on behaviour change, stated plainly: "GPU/resource: preserve 4 KiB texture alignment" (ce422300, AscilCH) changes how the title spaces its small textures — 4 KiB alignments are kept instead of being raised to 64 KiB in GetResourceAllocationInfo(2). It fixes the contradictory allocation info and the unaligned MSAA sizes that caused it, but it does move the title-memory layout. Our own Proton tree can restore the old layout with VICTORY_SMALL_ALIGN=0 (default = 4 KiB kept). We have not measured this fix in isolation — in our runs it always shipped with other switches — so treat the layout change as unmeasured, and drop just this commit if you want the old behaviour.

Testing — honest: this port applies cleanly to main commit by commit. It has NOT been compiled or run by the submitter (Linux, no Windows target, no game runs in this environment), so treat CI as the gate. No commit adds an environment variable, changes a default, or touches the shader translator version; every behavior change is a bug fix with its own tests inside the commit where the original added tests.

AI-assisted selection/verification (cherry-pick dry-run, author attribution, redundancy check); all code is the original authors'.

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:5526740697 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/460). Originally posted by [zocram4cc](https://github.com/zocram4cc) on 2026-11-27T12:36:43Z. --- Fourteen bug fixes cherry-picked from a third-party Proton/RADV port (zocram4cc/victory-linux-perf, `main`) onto `126acb35`. They apply cleanly one by one; original authors and commit messages are kept. **What they are:** GPU stability (query heap, CPU snapshot retry, 4 KiB texture alignment, APU heap use-after-free, command-queue release use-after-free, DirectStorage out-pointer, loader DLL case and `clzero`-loop decoding, gamepad output), plus five shader fixes (helper-lane `v_readfirstlane`, always-true/false float compares, gfx10 `_g16` gradient packing, an AMD compiler crash, a pos4 export). **Authors:** davutsimsekk, avt0m4t, AscilCH (×3), Peppacodes (×2), Vax, mynzjerko, libslibslibslibslibslibs. **Provenance:** curated from the RYUKI-7900XT / LibsMQG hle-d3d12-7900xtx fork line and contributor PRs; none of the fourteen is in `main` or in any open PR I could find (checked the open list against each commit). **One default-on behaviour change, stated plainly:** "GPU/resource: preserve 4 KiB texture alignment" (`ce422300`, AscilCH) changes how the title spaces its small textures — 4 KiB alignments are kept instead of being raised to 64 KiB in `GetResourceAllocationInfo(2)`. It fixes the contradictory allocation info and the unaligned MSAA sizes that caused it, but it does move the title-memory layout. Our own Proton tree can restore the old layout with `VICTORY_SMALL_ALIGN=0` (default = 4 KiB kept). We have not measured this fix in isolation — in our runs it always shipped with other switches — so treat the layout change as unmeasured, and drop just this commit if you want the old behaviour. **Testing — honest:** this port applies cleanly to `main` commit by commit. It has NOT been compiled or run by the submitter (Linux, no Windows target, no game runs in this environment), so treat CI as the gate. No commit adds an environment variable, changes a default, or touches the shader translator version; every behavior change is a bug fix with its own tests inside the commit where the original added tests. AI-assisted selection/verification (cherry-pick dry-run, author attribution, redundancy check); all code is the original authors'.
UwUCammie commented 2026-11-27 12:49:13 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by UwUCammie on 2026-11-27T12:49:13Z.


Two things I noticed while checking this against the Wine tree.

  • On the parent of b1d8db01, first_lane() already returns a pixel helper lane’s own value by default. The extra selection after that call repeats the same work and bypasses VICTORY_HELPER_OWN=0. Is there a case the existing path misses?
  • The shader cache still keys on TRANSLATOR_VERSION = 1 by default. A new source digest records that an entry is old, and normal runs still serve it unless refresh is enabled. The gradient and compare changes should bump the translator version so existing installs pick them up.
<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7218712203 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/460#issuecomment-7218712203). Originally posted by [UwUCammie](https://github.com/UwUCammie) on 2026-11-27T12:49:13Z. --- Two things I noticed while checking this against the Wine tree. - On the parent of `b1d8db01`, `first_lane()` already returns a pixel helper lane’s own value by default. The extra selection after that call repeats the same work and bypasses `VICTORY_HELPER_OWN=0`. Is there a case the existing path misses? - The shader cache still keys on `TRANSLATOR_VERSION = 1` by default. A new source digest records that an entry is old, and normal runs still serve it unless refresh is enabled. The gradient and compare changes should bump the translator version so existing installs pick them up.
UwUCammie commented 2026-11-27 12:52:12 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by UwUCammie on 2026-11-27T12:52:12Z.


I ran Peppacodes’s constant float compare test on the Wine branch. All 16 f16 and f32 cases passed on an RX 7900 XT with RADV 26.3.1 and vkd3d-proton 71cae091b06571e. The Wine port includes the cache version bump. Wine PR #8

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7218773303 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/460#issuecomment-7218773303). Originally posted by [UwUCammie](https://github.com/UwUCammie) on 2026-11-27T12:52:12Z. --- I ran Peppacodes’s constant float compare test on the Wine branch. All 16 f16 and f32 cases passed on an RX 7900 XT with RADV 26.3.1 and vkd3d-proton `71cae091b06571e`. The Wine port includes the cache version bump. [Wine PR #8](https://github.com/borntofrag34/VIctory-7900XTX/pull/8)
GiovanniFadanelli commented 2026-11-27 14:24:32 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by GiovanniFadanelli on 2026-11-27T14:24:32Z.


Superseded by #469: the same 14 commits plus three fix-ups (a test-isolation fix for the APU use-after-free test, the readfirstlane select obeying VICTORY_HELPER_OWN, translator version 1 → 2), built and tested on Windows with an RX 9070 XT. Results are in that PR.

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7220745107 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/460#issuecomment-7220745107). Originally posted by [GiovanniFadanelli](https://github.com/GiovanniFadanelli) on 2026-11-27T14:24:32Z. --- Superseded by #469: the same 14 commits plus three fix-ups (a test-isolation fix for the APU use-after-free test, the readfirstlane select obeying VICTORY_HELPER_OWN, translator version 1 → 2), built and tested on Windows with an RX 9070 XT. Results are in that PR.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/460:upstream-pr/460'
git switch 'upstream-pr/460'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/460'
git switch 'upstream-pr/460'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/460'
git switch 'upstream-pr/460'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/460'
git switch 'main'
git merge --squash 'upstream-pr/460'
git switch 'main'
git merge --ff-only 'upstream-pr/460'
git switch 'main'
git merge 'upstream-pr/460'
git push origin 'main'
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
avatarmanz/VIctory-7900XTX!460
No description provided.