tombox-xshader: amplification shaders always use the memory-based root ABI #316
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/316"
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?
Imported from omonkeyz/xbox-emulator. Originally posted by enderrr9 on 2026-11-23T18:05:33Z.
Builds on #313 and #315. The first two commits are those PRs. The new change is the last commit.
Bug
The console requires
FORCE_MEMORY_BASED_ABIfor every PSO with an amplification shader (mesh_pso::as_root_rule). An AS gets onlyCOMPUTE_USER_DATA_0..3:s[0:1]is root memory ands2/s3are the rings (BLOCKERS.md).hlsl/rootmem.rspicked the memory path only when ans_loadthroughs[0:1]came before the first branch.An AS whose first root load follows a branch took the register path instead:
s4bystatic_sgpr_init;finish_ampthen overwrotes4withgid.x;s_loadfroms[0:1]was dropped, so its SGPRs stayed 0.In the synthetic test, that AS launched no mesh groups and drew nothing, with no refusal.
Fix
detect_rootmemreturns true forStage::Amplificationwhenever the root signature has parameters. Other compute shaders keep the existing detection. It's a 4-line change inrootmem.rs.Test
gpu_synthetic_amplification_root_load_after_a_branch_still_uses_s0_s1: the same AS as the root-constant test from #313, withs_cmp_eq_u32+s_cbranch_scc1before thes_load_dwordx2. It checks that the HLSL loadss12from the root constant and doesn't touchs4, then renders on WARP.tests/amp.rs,tests/mesh.rsandtests/synthetic.rspass on WARP. The CI non-exec set (--lib --binsplus every test file exceptexec) passes too.pr_gate.py: no problems.BLOCKERS.md
amp.rsalready implements.rootmem.rscovers. It also lists what is still open:🤖 Generated with Claude Code
Imported from omonkeyz/xbox-emulator. Originally posted by omonkeyz on 2026-11-25T13:49:29Z.
Applied on main in
d19af94(cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.Pull request closed