Fix guest wave32 GDS counter returns in compute shaders #56
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!56
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/56/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?
@philip-roy-jones on GitHub · 2026-11-21 21:39 UTC · original
fix/gds-compute-wave32-returns→main· +151 −56 · 4 files · 1 commits · closed without mergingLibrary / area:
tombox-xshadercompute shadersExports changed (exports.txt rows): None
Source of the behaviour: AMD RDNA 2 ISA, section 12.13, DS_CONSUME and DS_APPEND and D3D12 wave size requirements.
On WARP, upstream
ds_appendandds_consumeeach return eight distinct old values within a fully active 32-lane guest wave. The final counter total is correct. The existing test skips the per-wave return assertion on WARP. Upstream already includes the M0 addressing change from #21.Straight-line compute shaders now form a guest EXEC mask in group memory. The first active lane updates the counter once and broadcasts its old value. Counters inside control flow or alongside the 32 KiB LDS mirror require a native wave32. The WARP regression covers full, partial and empty masks, wraparound, consecutive updates and the reserved GDS boundary.
cargo test --locked -p tombox-xshader --no-fail-faston Windows/WARP passed 134 tests on0fc7295and 135 on1c4638e. Both runs had zero failures and the same 12 ignored tests.cargo test --locked -p tombox-xshader --test exec exec_mem::gds::passed all three upstream cases and all four on this branch. Both opcodes now return one old value per active guest wave on WARP.cargo test --locked --release -p tombox-xshader --test exec exec_mem::gds::passed all four branch tests. DXC compiled the native path. Execution of that path still needs compatible hardware.Guest wave64 remains unsupported. A separate Shader Model 5.1 FXC smoke check failed on the shared
uint64_tpreamble on both revisions.cargo test -p tombox-xshaderpassesNo game or console files and no binaries included
No fake success; anything not possible is left
missingwith a note@QuentinDanblon on GitHub · 2026-11-21 21:44 UTC · original
FYI, related work:
fix/wave32-lane-halves(PR coming) maps a wave32 guest lane L to host lane(WaveGetLaneIndex() & ~31) | (L & 31)for v_readlane/v_writelane, the DPP row mask and the STATUS EXECZ/VCCZ bits, for hosts that run 64-lane waves. It doesn't touch GDS. Your guest-EXEC-in-group-memory approach for ds_append/consume shouldn't conflict, but we both edithlsl.rs, so whoever lands second rebases.Pull request closed