tombox-xshader: keep amplification DispatchMesh Z at 1 (args dword 2 is the payload pointer) #315
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!315
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/315/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 17:57 UTC · original
enderrr9:xshader-amp-args-pointer→main· +243 −16 · 4 files · 2 commits · closed without mergingBuilds on #313. The first commit here is #313's test harness. The new change is the second commit (
fbb7dd9).Bug
The console AS writes its mesh-args entry as
{X, 0, payload VA >> 4 high, payload VA >> 4 low}(fixture as3; see the BLOCKERS.md #115 CHECKED line).df91928(#136) made the translated AS callDispatchMesh(tb_args[0], max(tb_args[1], 1u), max(tb_args[2], 1u), tb_pl), so it reads dword 2 as Z.In the translator's ring address space the payload VA is
0x20_xxxx_xxxx, so dword 2 is2. Every amplification group therefore launched each of its mesh groups twice. The pixels don't change, because the duplicate groups draw the same primitives, so no existing test saw it.Fix
DispatchMesh(tb_args[0], max(tb_args[1], 1u), 1u, tb_pl):Test
render_pair()now also returns an occlusion-query sample count.gpu_synthetic_amplification_args_entry_with_the_payload_pointer_launches_each_mesh_group_once. The synthetic AS stores the console-shaped entry with oneglobal_store_dwordx4. Two AS groups launch 1 and 2 mesh groups, each drawing one pixel, so the test expects 3 samples. Before the fix: 6. After: 3.tests/amp.rs/tests/synthetic.rsare updated. The synthetic test is renamed toamplification_dispatch_uses_the_y_group_count_and_not_the_payload_pointer. The BLOCKERS.md #115 line now describes the current behaviour.cargo test -p tombox-xshader --locked --test amp --test synthetic --test mesh: all pass on WARP. The fixture tests stay ignored here.pr_gate.py: 4 files, 0 problems.Not covered
How the console compiler encodes Y/Z > 1 in the entry is still unverified, because no console AS seen so far calls a 2D/3D DispatchMesh. If someone has such a fixture,
gpu_console_amplification_...could also assert the sample count.🤖 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
c1ee4bf(cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.Pull request closed