tombox-xshader: MIMG image_load / image_store (ops 0x00-0x1F) unsupported #103
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#103
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@Trwthh on GitHub · 2026-11-22 09:16 UTC · original
Component:
crates/tombox-xshader/src/hlsl.rsWhat happens: The MIMG handler at line 5565-5566 only accepts sample ops (0x20-0x3F) and gather ops (0x40-0x5F). Any MIMG instruction with opcode < 0x20 — including
image_load,image_store,image_load_mip,image_store_mip— hits:Impact: Console games that use
image_load/image_storefor unstructured UAV texture access (common in compute shaders, post-processing, and deferred rendering) will fail shader translation entirely. These are RDNA2 opcodes 0x00-0x07 (load family) and 0x08-0x0F (store family) per the ISA reference.ISA reference: RDNA2 ISA manual, section 10.2 (MIMG), Table 56.
Suggested fix: Extend the MIMG handler to emit
tex.Load()for image_load variants andtex[coord] = valuefor image_store variants, with proper format/component handling.@QuentinDanblon on GitHub · 2026-11-22 11:03 UTC · original
These ops are already translated on main (
51f5319). The check quoted in the issue is the fall-through at the end of the MIMG handler; the texel-addressed ops return earlier in the same function:hlsl.rs5412:// Texel-addressed ops (no sampler): image_load / image_store, on SRVs or UAVs.The block handlesimage_load,image_load_mip,image_store,image_store_mip,image_atomic_addandimage_atomic_umax.hlsl.rs5372:image_get_resinfo.They are also executed, not only translated:
tests/exec_mem/mimg.rshasimage_load,image_store_mipandimage_get_resinfocases, andcargo test -p tombox-xshader --release --test execpasses 73 of 73 on WARP on that commit (mimg_store_mip: 1 mnemonics verified, 0 failing,mimg_query: 2 mnemonics verified, 0 failing).What is still refused in 0x00-0x1f is what the decoder does not name (
rdna2/mnem.rs301-303 names 0x00, 0x01, 0x08, 0x09, 0x0e, 0x11 and 0x17 only): the_pckforms and the other image atomics.tools/progress/data/mnemonics.txtlists no title use of those: the MIMG ops below 0x20 it counts areimage_load,image_load_mip,image_store,image_atomic_addandimage_atomic_umax, all translated.As written, I think this one can be closed.
@omonkeyz on GitHub · 2026-11-23 13:12 UTC · original
image_load, image_load_mip, image_store, image_store_mip, image_atomic_add/umax and image_get_resinfo are translated on main and covered by tests/exec_mem/mimg.rs. The ops still refused in 0x00-0x1f (_pck forms, other image atomics) have no known title use; a new issue is welcome if a shader needs one.