GPU, HLE, loader and shader: 14 bug fixes that apply cleanly to main #460
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!460
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-460"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@zocram4cc on GitHub · 2026-11-27 12:36 UTC · original
zocram4cc:up/pr-fixes-stability→main· +567 −53 · 17 files · 14 commits · openFourteen bug fixes cherry-picked from a third-party Proton/RADV port (zocram4cc/victory-linux-perf,
main) onto126acb35. 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-lanev_readfirstlane, always-true/false float compares, gfx10_g16gradient 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
mainor 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 inGetResourceAllocationInfo(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 withVICTORY_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
maincommit 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'.
Fix two resource allocation-info bugs in `crates/victory-gpu/src/resource.rs`: 1. `place()` initialized `total.alignment = KIB_64` and took `max(one.alignment)`, clobbering 4 KiB console texture alignments (e.g., 512x512 BC7 10 mips -> `{ size: 0x56000, alignment: 0x1000 }`) up to 64 KiB in `GetResourceAllocationInfo` / `GetResourceAllocationInfo2` (and producing contradictory `total.alignment = 64 KiB` vs `each[0].alignment = 4 KiB` in `GetResourceAllocationInfo2`). Start with `alignment: 0` and default to `KIB_64` only for empty descriptor lists. 2. `footprint()`'s fallback path rounded `size` to `KIB_64` instead of `alignment`, leaving `SizeInBytes` unaligned to `Alignment` for MSAA (`MIB_4`) or custom-aligned resources. Round to `alignment`. Extend `resource::tests::sizes_cover_every_mip` to verify both fixes.cmp rax, reg(decode part of bbd2408) 2162d0dd06From AscilCH's bbd2408 ("loader: fix ClzeroLoop ModRM decoding, >=2 GiB skip, unaligned/empty bounds, and EFlags"), the decoder part only: `decode` did not check that `48/4C 39 modrm` is register to register with rax as the destination, so `cmp rcx, rdx`, `cmp [rax], rdx` or `cmp rax, rax` after `clzero; add rax, 0x40` decoded as a ClzeroLoop. With the check those are a plain clzero, stepped one at a time. The emulation parts (>= 2 GiB, end <= start, unaligned, EFlags) are not taken: RYUKI rewrote the loop's emulation (passes capped at 2 GiB and continued, one pass for an end not above the start, flags from cmp_flags, a stub patched in on the first fault), which covers them.v_cmp_f_{f32,f16} and v_cmp_tru_{f32,f16} lowered to fcmp false and fcmp true (predicates 0 and 15). DXC folds those away, so drivers never see them from it, and WARP removes its device at the first dispatch of a pipeline that has one ("The GPU device instance has been suspended"). The hardware adapter (RTX 5080) runs them. A removed WARP device stays removed for the process, so everything after it fails too. They are false and true whatever the operands, NaNs included (RDNA2 ISA), so they now lower as constants, as the integer v_cmp_f/v_cmp_t already do. FALSE and TRUE stay in the predicate table, unused. Found with a sweep of every 32-bit VALU instruction on the hardware adapter against WARP: all 62 compares now run and agree on both. Test: float_compares_that_are_always_false_or_true, f32 and f16 with ordinary and NaN operands, on the hardware adapter and WARP. On main WARP's dispatch fails with the device suspended.@UwUCammie on GitHub · 2026-11-27 12:49 UTC · original
Two things I noticed while checking this against the Wine tree.
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 bypassesVICTORY_HELPER_OWN=0. Is there a case the existing path misses?TRANSLATOR_VERSION = 1by 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 on GitHub · 2026-11-27 12:52 UTC · original
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@GiovanniFadanelli on GitHub · 2026-11-27 14:24 UTC · original
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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.