xshader: honour MIMG UNORM and A16, and refuse MUBUF LDS/TFE #160
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!160
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/160/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?
@GDAgent on GitHub · 2026-11-22 16:49 UTC · original
GDAgent:port/xshader-mimg-unorm-refusals→main· +215 −23 · 3 files · 1 commits · closed without mergingLibrary / area: tombox-xshader (
hlsl.rs,tests/exec_mem/mimg.rs)Exports changed (exports.txt rows): none
Source of the behaviour: AMD RDNA2 ISA specification (§13.6.2 MUBUF Table 98, §13.7 MIMG Table 100) and Mesa ACO (
aco_select_nir.cppA16 operand packing). Ported from brcly/TomBox97db52fand9d3247a(MIT OR Apache-2.0); credit line extended inTHIRD_PARTY/CREDITS.Changes:
UNORM(dword0[12]) onimage_sample*,image_gather*, andimage_get_lodby querying mip-0 dimensions viaGetDimensionsand dividing spatial coordinates (and derivatives, when present) by the mip-0 size while leaving array slices unscaled; explicitly refuseUNORMon cube images (dim == 3).A16(dword1[30]) across texel-addressed ops (image_load*,image_store*,image_atomic_*, packed 16-bit uint coordinates),image_get_resinfo,image_get_lod, andimage_sample*/image_gather*(bias f16 in low half of its dword; coordinates, LOD, and clamp packed as f16 two per VGPR).LDS(dword0[16]) andTFE(dword1[23]) instead of silently ignoring them. The MIMGR128/TFE/LWErefusal already exists on main (#114); this change reuses it and only keeps the UNORM and A16 decoding next to it.image_store*data registers as live-in reads rather than writes inEmitter::live_in.UNORM(2D, 2D-array, explicit LOD) andA16(load, store,sample_lz,sample_l), plus explicit refusal checks (MIMG TFE and LWE through the existing refusal, MIMG UNORM on cube, MUBUF LDS, MUBUF TFE).Tests (native Windows 11; not run under Proton):
cargo test --release -p tombox-xshader --lib --test opcodes --test synthetic: 116 passed, 0 failed, 2 ignored.cargo test --release -p tombox-xshader --test exec -- image_mimg(D3D12 execution on hardware): 8 passed, includingimage_mimg_unorm_a16_and_refusals(UNORM and A16 cases, each rerun with runtime inputs, plus the refusal checks).The full exec suite has 3 failures that also occur on plain
main:scalar_smem_loads,exec_mem::mtbuf::mtbuf_d16_store_formats,vop::basic::vop2_basic. Nothing extra fails with this change.Not verified in a title with this repo's build.
Related, not fixed here: #103 (MIMG load/store coverage). #114 (R128/TFE/LWE) is already fixed on
main; this change reuses that refusal.cargo test -p tombox-xshadertests passNo game or console files and no binaries included
No fake success; unsupported LDS/TFE/UNORM-cube forms fail explicitly
@omonkeyz on GitHub · 2026-11-22 17:10 UTC · original
Applied in
d7d72fe(merged in43d17b0) with your authorship kept, thanks.Pull request closed