xshader: support QDMode ds_swizzle_b32 in compute shaders #70
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/brcly--TuxBox!70
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/70/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?
@JohnVonWells on GitHub · 2026-11-24 15:56 UTC · original
xshader/compute-quad-swizzle→main· +866 −4 · 6 files · 1 commits · merged 2026-11-24 19:48 UTCProblem
An ordinary compute
ds_swizzle_b32refused every offset with bit 15 set (emit_compute_swizzle,raw[0] & 0x3_8000). Bit 15 selects QDMode (RDNA2 ISA,DS_SWIZZLE_B32): lane i of each quad reads laneoffset[2i+1:2i]of the same quad. Pixel shaders and the wave32 resolve path already lower QDMode. Ordinary compute shaders did not.The log shared in #39 (
3086e0b) has two compute shaders refused withunsupported compute DS swizzle encoding(a7311ea4…,e6559079…). GDS is the only other bit the old check covered, and GDS makes no sense on a swizzle, so QDMode is the likely cause.Change
emit_compute_swizzlelowers QDMode through the existing group-shared exchange:tb_swizzle[(tb_lane & ~3u) | ((pattern >> (2u * (tb_lane & 3u))) & 3u)]. Inactive lanes still contribute 0 and skip the write, as in bit-mask mode.0x8000..0x80ffare accepted, the same bound as the resolve path. GDS, bit 16 and the other high offset bits stay refused.Validation
hlsl/compute_swizzle.rs): QDMode lowering including the source register, bit-mask regression, and refusal of0x8100,0xe000,0xffff, bit 16 and GDS. The QDMode test fails on the previous code. Shader compiler: 83 passed. Python suite: 128 passed.tools/check_compute_swizzle.py, modelled oncheck_wave_guard.py): it runs the translator's real output for 8 QDMode offsets (identity, reverse, pair/half swaps, broadcasts, irregular) and 5 bit-mask offsets under 8 lane masks (full, odd, lane 0, empty, 4 random). It compares all 384 words of the guarded buffer. 104/104 matched on an RX 6950 XT (1002:73a5), Proton Experimental 11.0-20261112, DXC 1.9.2609. Evidence:evidence/scarlett-compute-swizzle-control.json.>> (lane & 3)): 34 cases mismatched, all QDMode, no bit-mask case.AI-assisted contribution.
🤖 Generated with Claude Code