tombox-xshader: translate the remaining 32-bit image atomics and honour GLC #147
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!147
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/147/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?
@MiguelMatMar on GitHub · 2026-11-22 15:56 UTC · original
MiguelMatMar:image-atomics→main· +117 −67 · 5 files · 1 commits · closed without mergingLibrary / area:
tombox-xshader(RDNA2 MIMG decoder + HLSL translation). Covers the image-atomic part of #103.Exports changed (exports.txt rows): none.
Source of the behaviour: opcode numbers from the public GFX10/RDNA2 MIMG opcode table (0x0f swap, 0x10 cmpswap, 0x12 sub, 0x14 smin, 0x15 umin, 0x16 smax, 0x18 and, 0x19 or, 0x1a xor, 0x1b inc, 0x1c dec; 0x11 add and 0x17 umax were already mapped). Operation semantics (cmpswap DATA[0] = src, DATA[1] = cmp; inc/dec wrap rules; GLC returns the pre-op value) from the RDNA2 ISA manual, identical to the MUBUF atomics the translator already implements.
Changes
rdna2/mnem.rs: decode the 11 missing 32-bit integer image atomics.hlsl/atomic.rs(new): the Interlocked* / compare-exchange-loop lowering that the MUBUF atomics used inline, keyed by the op suffix. MUBUF atomics now call it, and their output is unchanged (buffer_mubufand theopcodesstring checks still pass).hlsl.rs: image atomics go through the same helper on theRWTexture<uint>texel._pckloads/stores. They stay unmapped or refused.Tests
New
exec_mem::mimg::image_mimg_atomics: 13 mnemonics × 8 operand/compare pairs × GLC on/off (208 cases, each also rerun with runtime inputs). Each case checks the returned vdata, the texel result and two untouched neighbours on an R32_UINT UAV (addsR32_UINTto the exec_mem image helper).Passes on WARP and on hardware (
TOMBOX_EXEC_HW=1, NVIDIA).I also checked that the test catches the bug: forcing the old always-write-vdata behaviour makes 52 cases fail.
Full
cargo test -p tombox-xshaderpasses.pr_gate.pyreports 0 problems.cargo test -p tombox-xshaderpassesNo game or console files and no binaries included
No fake success; anything not possible is left
missingwith a note🤖 Generated with Claude Code
@omonkeyz on GitHub · 2026-11-22 16:27 UTC · original
Applied in
4160c9a(merged in604b5a1) with your authorship kept, thanks, and thanks for checking that the test catches the old GLC bug!Pull request closed