tombox-xshader: lower ds_swizzle_b32 bit and quad modes in compute shaders #184
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!184
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/184/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?
@MeNoSkills on GitHub · 2026-11-22 22:02 UTC · original
MeNoSkills:feat/ds-swizzle-compute→main· +57 −4 · 3 files · 1 commits · closed without mergingUntil now ds_swizzle_b32 translated only in a pixel shader with QDMode (bit 15); any other use, including every use in a compute shader, failed with "ds_swizzle outside a pixel shader" (or "without QDMode unsupported"). It is used by compute shaders for lane exchanges within a 32-lane group.
Change
In a compute shader, ds_swizzle_b32 now goes through the same lane-exchange lowering as ds_bpermute_b32 (WaveReadLaneAt, or the groupshared exchange when the shader has no LDS). The source lane inside the 32-lane group is computed per lane from the offset:
Offsets >= 0xC000 (the rotate and FFT modes) are refused with a message that names them; I do not have the ISA text to check their semantics, so I did not guess. The pixel-shader quad path is unchanged.
Tests
exec_mem::ds::ds_swizzle_compute: 12 bit-mode offsets (identity 0x001f, neighbour swap 0x041f, xor 16 = 0x401f, and-masks, broadcast of a lane, mixed masks, 0x7fff) and 8 quad permutations, on 64 threads (two groups of 32), against a reference computed from the formulas above. 20/20 on WARP and on an RTX 4070 Ti; without the change all 20 fail with "ds_swizzle outside a pixel shader".exec_mem::ds::ds_swizzle_rotate_and_fft_are_refused_in_compute.--lib85,--test synthetic22,--test isa_sweep2 (541 mnemonics),--test mesh24,--test exec ds_18, all passing. pr_gate: 0 problems.Not verified
No real shader: I do not have a title dump. The source-lane formulas come from the DS_SWIZZLE_B32 description, not from a console shader. Wave64 is not covered (compute here is two 32-lane groups).
@omonkeyz on GitHub · 2026-11-22 23:23 UTC · original
Applied in
3828799(merged in42511d7) with your authorship kept, thanks. The full tombox-xshader suite passes on WARP.Pull request closed