Recompiler: preserve the FSPX compute user SGPR count #216

Merged
Kalmarv merged 1 commit from upstream-pr/219 into main 2026-11-23 21:24:02 +00:00
Kalmarv commented 2026-11-23 21:14:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-23T21:14:26Z.


Follows #146.

XCL already reads COMPUTE_PGM_RSRC2 when translating an ACCC/FSPX compute shader. Pipeline creation previously looked only in FSSM for the user SGPR count, so binding and replay could fall back to the root-layout heuristic even when FSPX supplied the count. For a shader with four user SGPRs, all four are reserved and its root arguments belong in the argument table.

Read the FSPX count during pipeline metadata lookup and share register decoding with shader translation. The regression test builds two synthetic FSPX containers, sets unrelated bits around the count field, and checks counts of four and eight.

Tested

Windows 11 Pro 26200, Ryzen 9 9950X, x64 MSVC Rust 1.99.0. All checks were CPU-only.

  • Base 6da33fa7ad8c956e2ef72ed9769e3c96f7ac986a with only the new test applied. cargo test -j2 -p xcl --lib fspx_compute_user_sgprs_from_rsrc2 failed 1/1 as expected. Both containers parsed and returned the encoded register words, but the pipeline lookup returned [None, None].
  • Branch head 033a6d1fdf5ecb62fa45a6e865601c20ca53012d, directly on that base. The same test passed 1/1 with [Some(4), Some(8)]. The library test binary also passed all four hle::d3d12x::console_list::tests:: argument-layout tests and all eight gpu::xbox::tests:: container tests. Total 13 passed, 0 failed.

Not tested

  • GPU dispatch using an FSPX pipeline, a retail shader pack, or game output.
  • The full workspace suite.

AI use: Codex, GPT-6.2 Astra.

<!-- greyfinch-sync:ivall/xcl:issue:6568968227 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/219). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-23T21:14:26Z. --- Follows #146. XCL already reads `COMPUTE_PGM_RSRC2` when translating an `ACCC/FSPX` compute shader. Pipeline creation previously looked only in FSSM for the user SGPR count, so binding and replay could fall back to the root-layout heuristic even when FSPX supplied the count. For a shader with four user SGPRs, all four are reserved and its root arguments belong in the argument table. Read the FSPX count during pipeline metadata lookup and share register decoding with shader translation. The regression test builds two synthetic FSPX containers, sets unrelated bits around the count field, and checks counts of four and eight. **Tested** Windows 11 Pro 26200, Ryzen 9 9950X, x64 MSVC Rust 1.99.0. All checks were CPU-only. - Base `6da33fa7ad8c956e2ef72ed9769e3c96f7ac986a` with only the new test applied. `cargo test -j2 -p xcl --lib fspx_compute_user_sgprs_from_rsrc2` failed 1/1 as expected. Both containers parsed and returned the encoded register words, but the pipeline lookup returned `[None, None]`. - Branch head `033a6d1fdf5ecb62fa45a6e865601c20ca53012d`, directly on that base. The same test passed 1/1 with `[Some(4), Some(8)]`. The library test binary also passed all four `hle::d3d12x::console_list::tests::` argument-layout tests and all eight `gpu::xbox::tests::` container tests. Total 13 passed, 0 failed. **Not tested** - GPU dispatch using an FSPX pipeline, a retail shader pack, or game output. - The full workspace suite. **AI use**: Codex, GPT-6.2 Astra.
upstream-sync closed this pull request 2026-11-24 06:57:42 +00:00
ivall commented 2026-11-24 07:04:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T21:24:23Z.


Merged (main d4f17ca). Checked on an RX 9070 (RDNA4) with 11 PRs merged together on main af20b4b: cargo build --workspace && cargo test --workspace -- --test-threads=4 - 605 unit tests passed, 0 failed (20 ignored), the integration and e2e tests passed; and the retail game still reaches its first menu at 30 fps (720 draws per 2 s).

<!-- greyfinch-sync:ivall/xcl:comment:7114417360 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/219#issuecomment-7114417360). Originally posted by [ivall](https://github.com/ivall) on 2026-11-23T21:24:23Z. --- Merged (main d4f17ca). Checked on an RX 9070 (RDNA4) with 11 PRs merged together on main af20b4b: `cargo build --workspace && cargo test --workspace -- --test-threads=4` - 605 unit tests passed, 0 failed (20 ignored), the integration and e2e tests passed; and the retail game still reaches its first menu at 30 fps (720 draws per 2 s).
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
xcl-dev/xcl!216
No description provided.