tombox-xshader: amplification shaders always use the memory-based root ABI #316
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
library
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/omonkeyz--xbox-emulator!316
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/316/head"
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?
@enderrr9 on GitHub · 2026-11-23 18:05 UTC · original
enderrr9:xshader-amp-rootmem-rule→main· +271 −20 · 5 files · 3 commits · closed without mergingBuilds 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
The console AS writes its mesh-args entry as {X, 0, payload VA >> 4 high, payload VA >> 4 low} (as3, BLOCKERS.md #115 CHECKED).df91928started reading Y and Z from dwords 1 and 2. In the translator's ring address space the payload VA is 0x20_xxxx_xxxx, so dword 2 is 2, and every amplification group launched its mesh groups twice (Z = 2). The pixels don't change, because the duplicates draw the same primitives, so the extra work was invisible to the existing tests. DispatchMesh now takes X from dword 0 and Y from dword 1 (0 in as3, so 1), and keeps Z at 1. Test: render_pair() now also returns an occlusion-query sample count. A new synthetic AS stores the console-shaped entry with one global_store_dwordx4 and must draw exactly 3 samples for 1 + 2 mesh groups. Before this change it drew 6. The two existing synthetic GPU tests also check their sample counts (3 and 4). The pinned HLSL strings in tests/amp.rs and tests/synthetic.rs and the BLOCKERS.md line are updated. Co-Authored-By: Claude Opus 5.5 <[email protected]>@omonkeyz on GitHub · 2026-11-25 13:49 UTC · original
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