Shaders: do not parse VS inputs when reading mesh shader stage I/O (port of VIctory#1366) #187

Open
github-bot wants to merge 1 commit from github-bot/gh-187 into main AGit
Owner

@⁠lcg007xd-c on GitHub · 2026-11-25 20:25 UTC · original
lcg007xd-c:port/vic-1366 → main · +27 −15 · 1 files · 1 commits · open

Port of Marvisak/VIctory#1366 by mgunes1311-lab. It is cherry-picked with -x, so the commit keeps its author and its upstream hash. This fork's main (000ffdd) does not have it, and it is not in #142.

What it fixes

Mesh-stage I/O parsing also read the vertex-input count of the stage data, which mesh programs leave unused. A garbage value there (E+0xc4) made native_programs fail, so the whole mesh program was rejected.

Tested (Linux, Rust 1.98.1)

  • native::tests::mesh_stage_io_ignores_unused_vs_input_count: fails on this fork's main (panic at native.rs:1439), passes with the port.
  • cargo test -p victory-shader --lib on this branch alone: no failures.
  • It applies to main without conflicts, and does not depend on the other open ports.

Not run here: Windows/GPU tests, since I have no Windows machine.

🤖 Generated with Claude Code

**@⁠lcg007xd-c** on GitHub · 2026-11-25 20:25 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/187) `lcg007xd-c:port/vic-1366` → `main` · +27 −15 · 1 files · 1 commits · open Port of [Marvisak/VIctory#1366](https://github.com/Marvisak/VIctory/pull/1366) by mgunes1311-lab. It is cherry-picked with `-x`, so the commit keeps its author and its upstream hash. This fork's `main` (000ffdd) does not have it, and it is not in #142. ## What it fixes Mesh-stage I/O parsing also read the vertex-input count of the stage data, which mesh programs leave unused. A garbage value there (`E+0xc4`) made `native_programs` fail, so the whole mesh program was rejected. ## Tested (Linux, Rust 1.98.1) - `native::tests::mesh_stage_io_ignores_unused_vs_input_count`: **fails on this fork's main** (panic at native.rs:1439), passes with the port. - `cargo test -p victory-shader --lib` on this branch alone: no failures. - It applies to `main` without conflicts, and does not depend on the other open ports. **Not run here:** Windows/GPU tests, since I have no Windows machine. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
(cherry picked from commit 4e155a36ad728e1a21e7253ff4097af06582a45f)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:37:33 +00:00
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-26 05:00 UTC · original

RDNA2 data point. This PR (ee5b909) merged on main 4f62c2a, cargo test --release -p victory-shader --lib on an RX 6950 XT (Windows 11 build 26300, Rust 1.98.1):

  • main: 275 passed, 2 failed.
  • This PR: 276 passed, 2 failed, in 2 runs out of 2. The new test passes.

The 2 failures are the same as on main: the RDNA2 wave-size tests scalar_counted_in_a_divergent_loop_read_after_it and scalar_counted_in_nested_divergent_loops, fixed by #110 and #204. No regression here. Not run in the game.

harness machine: rx6950xt-w11 | AMD Radeon RX 6950 XT (RDNA2), driver 32.0.21045.29003 | 32 GB RAM | Windows 11 build 26300

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-26 05:00 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/187#issuecomment-7183092719) RDNA2 data point. This PR (`ee5b909`) merged on `main` `4f62c2a`, `cargo test --release -p victory-shader --lib` on an RX 6950 XT (Windows 11 build 26300, Rust 1.98.1): - `main`: 275 passed, 2 failed. - This PR: 276 passed, 2 failed, in 2 runs out of 2. The new test passes. The 2 failures are the same as on `main`: the RDNA2 wave-size tests `scalar_counted_in_a_divergent_loop_read_after_it` and `scalar_counted_in_nested_divergent_loops`, fixed by #110 and #204. No regression here. Not run in the game. harness machine: rx6950xt-w11 | AMD Radeon RX 6950 XT (RDNA2), driver 32.0.21045.29003 | 32 GB RAM | Windows 11 build 26300 AI-assisted (Claude Code); no game data.
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-26 19:43 UTC · original

Tested on Windows 11, RX 7900 XT (RDNA3, driver 32.0.32029.2010), Rust 1.98.1.

The PR commit sits on 000ffdd. It merges cleanly onto the current main 4f62c2a, because native.rs did not change between them. I tested the merged state: 4f62c2a + ee5b909.

Full game shaders.rpf, translate --validate --list --host-lanes 32-64, compared with 4f62c2a:

  • 26084 of 26084 translated, 40601701 IR instructions. Both unchanged.
  • VS/PS 14247/14247, CS 2682/2682, MS 8694 of 8765 emitted. All emitted programs validate. Unchanged.
  • Refusals unchanged: 195 "address in an SGPR that is no root parameter" and 71 "mesh outputs beyond the host's 32 KiB".
  • DXIL hashes of all 25623 emitted programs: 0 changed.

The game does not hit this case. On 4f62c2a, all 8765 mesh programs already get through native parsing. None is refused with "implausible semantic count". So for this title the change is a robustness fix only.

Tests (Windows, native):

  • cargo test -p victory-shader --lib -- --test-threads=1: 278 passed, 0 failed, 6 ignored. 4f62c2a gives 277/0/6. The extra one is the new test.
  • With only the new test applied to 4f62c2a, it fails with Malformed("implausible semantic count"). With the fix, it passes.

Not tested: other lane configs (32-32, 64-64), and running the game.

**@⁠adrianmjim** on GitHub · 2026-11-26 19:43 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/187#issuecomment-7201891090) Tested on Windows 11, RX 7900 XT (RDNA3, driver 32.0.32029.2010), Rust 1.98.1. The PR commit sits on 000ffdd. It merges cleanly onto the current main 4f62c2a, because native.rs did not change between them. I tested the merged state: 4f62c2a + ee5b909. Full game shaders.rpf, `translate --validate --list --host-lanes 32-64`, compared with 4f62c2a: - 26084 of 26084 translated, 40601701 IR instructions. Both unchanged. - VS/PS 14247/14247, CS 2682/2682, MS 8694 of 8765 emitted. All emitted programs validate. Unchanged. - Refusals unchanged: 195 "address in an SGPR that is no root parameter" and 71 "mesh outputs beyond the host's 32 KiB". - DXIL hashes of all 25623 emitted programs: 0 changed. The game does not hit this case. On 4f62c2a, all 8765 mesh programs already get through native parsing. None is refused with "implausible semantic count". So for this title the change is a robustness fix only. Tests (Windows, native): - `cargo test -p victory-shader --lib -- --test-threads=1`: 278 passed, 0 failed, 6 ignored. 4f62c2a gives 277/0/6. The extra one is the new test. - With only the new test applied to 4f62c2a, it fails with `Malformed("implausible semantic count")`. With the fix, it passes. Not tested: other lane configs (32-32, 64-64), and running the game.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/187/head:github-bot/gh-187'
git switch 'github-bot/gh-187'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-187'
git switch 'github-bot/gh-187'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-187'
git switch 'github-bot/gh-187'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-187'
git switch 'main'
git merge --squash 'github-bot/gh-187'
git switch 'main'
git merge --ff-only 'github-bot/gh-187'
git switch 'main'
git merge 'github-bot/gh-187'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.