Carry 20 upstream VIctory fixes (shaders, samplers, textures) and a mesh wave-ops flag fix #142

Open
YisusOnDev wants to merge 22 commits from upstream-pr/142 into main
YisusOnDev commented 2026-11-25 16:32:03 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by YisusOnDev on 2026-11-25T16:32:03Z.


Carries 20 commits from upstream Marvisak/VIctory that this fork does not have yet, plus two fixes needed to make them build and test here. All of them are small fixes to shaders, samplers, textures and pipelines.

A full git merge upstream/main gave about 450 conflicts, so these were cherry-picked one by one, with -x to keep the upstream hash. The upstream changes to memory copies (cd94d35, 940d32f, ed0dbfd) and the pipeline pre-build (c47b529, 9c58a1c) are left out, because the fork's shadow.rs and host.rs have diverged too far for a clean pick.

Commits:

  • GPU: copy into title memory without asking for its region first
  • GPU: fix CreateSamplerX mip-none base level, LOD range, bias clamp, and invalid enum values
  • Inline uniform micro-tile runs in texture copies
  • Shaders: reuse lane guards for unchanged EXEC within a block
  • fix(pipeline): retry collisions when creating cache staging files
  • Formats: share immutable texture swizzle tables
  • GPU: pipelines of different names load from the library at the same time
  • Shaders: fold conditional branches to their fallthrough
  • Shaders: compress replaced phi chains in remove_trivial_phis
  • GPU: keep A8_UNORM out of the R8 typeless family
  • Shaders: preserve mip point filtering in anisotropic static samplers
  • GPU: honor anisotropic point-mip device support
  • GPU list: bind initial pipeline state in create_list and create_list_x
  • Shaders: fold empty loop latches containing only dead phis
  • Shaders: precompute MD5 round constants and avoid per-block Vec in md5_block
  • Shaders: key immediate sampler slots by descriptor words and comparison mode
  • Shaders: GFX10 FLAT offsets ignore bit 11
  • victory-shader: mask mesh primitive vertex indices to 9 bits (drop edge flags)
  • Shaders: gate anisotropic point-mip host filters
  • Tests of the picked upstream commits use the fork's signatures
  • Mesh lanes from the thread id declare no wave ops; GPU tests share one lock
  • GPU: align appended input-element offsets like D3D12

Notes:

  • Mesh shader fix (Mesh lanes from the thread id declare no wave ops). Mesh programs that read their lane index from the thread id declared WAVE_OPS without using any wave operation, and the DXIL validator rejects that. The new upstream mesh test found it.
  • GPU: align appended input-element offsets like D3D12. Its one conflict, in pipeline/host.rs, was resolved by keeping both test modules: the fork's integer-blend tests and upstream's input-offset tests.
  • One test in victory-shader and victory-gpu adapts the picked tests to the fork's function signatures.

Testing, on an RX 9070 XT with Windows 11:

  • cargo build --profile diag -p victory --features diagnostics builds.
  • cargo test --release -p victory-shader -p victory-gpu -p victory-formats: all pass except list::tests::lists_are_cut_at_waits_that_follow_work, which fails the same way on this fork's main (f870d80) without these commits. cargo fmt --check also fails on main already.
  • In game, the intro cutscene and the first cell scene render correctly (lit, textured, other inmates visible). Frame time there was ~250–273 ms, against ~340 ms measured before rebasing on this fork's newer main. Most of that gain comes from main itself (PR #18 and others), not from these picks.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XT2tTx3gzfkPGgizfErPrL

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:issue:6608986720 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/142). Originally posted by [YisusOnDev](https://github.com/YisusOnDev) on 2026-11-25T16:32:03Z. --- Carries 20 commits from upstream Marvisak/VIctory that this fork does not have yet, plus two fixes needed to make them build and test here. All of them are small fixes to shaders, samplers, textures and pipelines. A full `git merge upstream/main` gave about 450 conflicts, so these were cherry-picked one by one, with `-x` to keep the upstream hash. The upstream changes to memory copies (cd94d35, 940d32f, ed0dbfd) and the pipeline pre-build (c47b529, 9c58a1c) are left out, because the fork's `shadow.rs` and `host.rs` have diverged too far for a clean pick. Commits: - GPU: copy into title memory without asking for its region first - GPU: fix CreateSamplerX mip-none base level, LOD range, bias clamp, and invalid enum values - Inline uniform micro-tile runs in texture copies - Shaders: reuse lane guards for unchanged EXEC within a block - fix(pipeline): retry collisions when creating cache staging files - Formats: share immutable texture swizzle tables - GPU: pipelines of different names load from the library at the same time - Shaders: fold conditional branches to their fallthrough - Shaders: compress replaced phi chains in remove_trivial_phis - GPU: keep A8_UNORM out of the R8 typeless family - Shaders: preserve mip point filtering in anisotropic static samplers - GPU: honor anisotropic point-mip device support - GPU list: bind initial pipeline state in create_list and create_list_x - Shaders: fold empty loop latches containing only dead phis - Shaders: precompute MD5 round constants and avoid per-block Vec in md5_block - Shaders: key immediate sampler slots by descriptor words and comparison mode - Shaders: GFX10 FLAT offsets ignore bit 11 - victory-shader: mask mesh primitive vertex indices to 9 bits (drop edge flags) - Shaders: gate anisotropic point-mip host filters - Tests of the picked upstream commits use the fork's signatures - Mesh lanes from the thread id declare no wave ops; GPU tests share one lock - GPU: align appended input-element offsets like D3D12 Notes: - **Mesh shader fix (`Mesh lanes from the thread id declare no wave ops`).** Mesh programs that read their lane index from the thread id declared `WAVE_OPS` without using any wave operation, and the DXIL validator rejects that. The new upstream mesh test found it. - **`GPU: align appended input-element offsets like D3D12`.** Its one conflict, in `pipeline/host.rs`, was resolved by keeping both test modules: the fork's integer-blend tests and upstream's input-offset tests. - **One test** in `victory-shader` and `victory-gpu` adapts the picked tests to the fork's function signatures. Testing, on an RX 9070 XT with Windows 11: - `cargo build --profile diag -p victory --features diagnostics` builds. - `cargo test --release -p victory-shader -p victory-gpu -p victory-formats`: all pass except `list::tests::lists_are_cut_at_waits_that_follow_work`, which fails the same way on this fork's `main` (f870d80) without these commits. `cargo fmt --check` also fails on `main` already. - In game, the intro cutscene and the first cell scene render correctly (lit, textured, other inmates visible). Frame time there was ~250–273 ms, against ~340 ms measured before rebasing on this fork's newer `main`. Most of that gain comes from `main` itself (PR #18 and others), not from these picks. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01XT2tTx3gzfkPGgizfErPrL
adrianmjim commented 2026-11-25 19:52:54 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by adrianmjim on 2026-11-25T19:52:54Z.


Corpus data from the game's shaders.rpf on an RX 7900 XT (Windows 11 build 26300, dxil.dll 10.0.26100.0), head aadd4c8 on 01aadd1, victory translate --validate --list --host-lanes 32-64, comparing a hash of each program's DXIL with 01aadd1:

  • The DXIL of all 8,694 emitted mesh programs changes, as expected from the primitive index mask, and all of them validate. No vertex, pixel or compute program changes, and the counts are the same (VS/PS 14,247, CS 2,682, MS 8,694 of 8,765; the 71 over-budget mesh programs are still refused).
  • cargo test -p victory-shader --lib -- --test-threads=1: 279 passed, 0 failed, 6 ignored.

Pipelines were not created and the game was not run here.

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:comment:7172890784 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/142#issuecomment-7172890784). Originally posted by [adrianmjim](https://github.com/adrianmjim) on 2026-11-25T19:52:54Z. --- Corpus data from the game's `shaders.rpf` on an RX 7900 XT (Windows 11 build 26300, dxil.dll 10.0.26100.0), head `aadd4c8` on `01aadd1`, `victory translate --validate --list --host-lanes 32-64`, comparing a hash of each program's DXIL with `01aadd1`: - The DXIL of all 8,694 emitted mesh programs changes, as expected from the primitive index mask, and all of them validate. No vertex, pixel or compute program changes, and the counts are the same (VS/PS 14,247, CS 2,682, MS 8,694 of 8,765; the 71 over-budget mesh programs are still refused). - `cargo test -p victory-shader --lib -- --test-threads=1`: 279 passed, 0 failed, 6 ignored. Pipelines were not created and the game was not run here.
HAL9000RELOADED commented 2026-11-25 22:53:12 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by HAL9000RELOADED on 2026-11-25T22:53:12Z.


RX 7900 XTX (RDNA3), driver 32.0.32015.7029, Windows 10 22H2 (19045), Agility SDK 1.620 (#44). PR aadd4c8 merged on a7fa35e (main + #44).

  • stub_pipeline_is_created fails in the full victory-shader run with the PR ("digest [00, ...] accepted"): 289 passed, 1 failed. It passes on the base, and with the PR it passes on its own (10 of 10) and with --test-threads=1.
  • Narrowed down by halving the test list: the trigger is the new edge_flagged_triangles_draw_as_unflagged_ones running at the same time (3 of 3 runs with only those two tests). That test holds ONE_AT_A_TIME, the stub test doesn't, and both build pipelines from constant_color() on the same adapter. Holding the same lock in the stub test would keep them apart (not tried).
  • victory-gpu in release: lists_are_cut_at_waits_that_follow_work fails with and without the PR, as you saw on the 9070 XT. The test binary also exits now and then with 0xc0000005 (2 of 5 runs on the base, 1 of 5 with the PR), so neither comes from this PR.
<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:comment:7176900169 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/142#issuecomment-7176900169). Originally posted by [HAL9000RELOADED](https://github.com/HAL9000RELOADED) on 2026-11-25T22:53:12Z. --- RX 7900 XTX (RDNA3), driver 32.0.32015.7029, Windows 10 22H2 (19045), Agility SDK 1.620 (#44). PR `aadd4c8` merged on `a7fa35e` (main + #44). - `stub_pipeline_is_created` fails in the full `victory-shader` run with the PR ("digest [00, ...] accepted"): 289 passed, 1 failed. It passes on the base, and with the PR it passes on its own (10 of 10) and with `--test-threads=1`. - Narrowed down by halving the test list: the trigger is the new `edge_flagged_triangles_draw_as_unflagged_ones` running at the same time (3 of 3 runs with only those two tests). That test holds `ONE_AT_A_TIME`, the stub test doesn't, and both build pipelines from `constant_color()` on the same adapter. Holding the same lock in the stub test would keep them apart (not tried). - `victory-gpu` in release: `lists_are_cut_at_waits_that_follow_work` fails with and without the PR, as you saw on the 9070 XT. The test binary also exits now and then with 0xc0000005 (2 of 5 runs on the base, 1 of 5 with the PR), so neither comes from this 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/142:upstream-pr/142'
git switch 'upstream-pr/142'

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/142'
git switch 'upstream-pr/142'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/142'
git switch 'upstream-pr/142'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/142'
git switch 'main'
git merge --squash 'upstream-pr/142'
git switch 'main'
git merge --ff-only 'upstream-pr/142'
git switch 'main'
git merge 'upstream-pr/142'
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
Belobug/VIctory-Belobug-AMD!142
No description provided.