tombox-xshader: decode and translate the MUBUF D16 byte/short loads and d16_hi stores #235
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!235
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/235/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?
@azerioxfr on GitHub · 2026-11-23 06:29 UTC · original
azerioxfr:xshader-mubuf-d16-subword→main· +45 −3 · 3 files · 1 commits · closed without mergingLibrary / area: tombox-xshader, MUBUF sub-dword accesses:
buffer_load_{ubyte,sbyte,short}_d16{,_hi},buffer_store_{byte,short}_d16_hiExports changed (exports.txt rows): none
Source of the behaviour: opcodes from
tests/isa_table/gfx1013.txt(MUBUF 0x19, 0x1b, 0x20..0x25). Semantics from the RDNA2 ISA descriptions, lowered the same way as the LDS D16 forms in28f54b2.One topic, +45 / -3: 4 lines in
rdna2/mnem.rs, 17 inhlsl.rs, 23 lines of test.What was missing
These eight opcodes were not decoded.
tests/isa_table.rslists them under "mubuf: 37 gfx1013 opcodes not named by the decoder", so a shader that used one failed translation.The change
buffer_load_ubyte_d16/buffer_load_sbyte_d16(0x20 / 0x22)buffer_load_ubyte_d16_hi/buffer_load_sbyte_d16_hi(0x21 / 0x23)buffer_load_short_d16/_hi(0x24 / 0x25)buffer_store_byte_d16_hi/buffer_store_short_d16_hi(0x19 / 0x1b)InterlockedAnd/InterlockedOrmerge asbuffer_store_byte/_shortThe loads read vdst for the kept half, as the LDS D16 reads do.
Tests
buffer_mubufgains the six loads (vdst preloaded with0x5a5aa5a5, so the kept half is checked) and both stores, at the five existing address / offset pairs:--release, DXC 1.9.2609)buffer_mubufon this branchhlsl.rs(mutation)--test isa_table,--test opcodesRun on
x86_64-pc-windows-gnu(no MSVC linker here); these are integer-only paths.cargo test -p tombox-xshader --test exec -- --exact buffer_mubufpassesmissingwith a note@omonkeyz on GitHub · 2026-11-23 08:44 UTC · original
Applied in
283ac34(merged ind8d37e4) with your authorship kept, thanks. It shipped in r32h (e67e3d4), which passed its Trackmania control run; the TM shader corpus showed no output changes.Pull request closed