tombox-xshader: translate gfx7 MTBUF dfmt/nfmt to RDNA2 unified formats #37
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!37
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/37/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?
@dea7hsmiless on GitHub · 2026-11-21 18:52 UTC · original
xshader/gfx7-mtbuf→main· +127 −1 · 1 files · 102 commits · closed without mergingLibrary / area:
crates/tombox-xshader(Durango/gfx7 to RDNA2 lowering)Exports changed (exports.txt rows): none
Source of the behaviour: LLVM AMDGPU encoding definitions and tables:
BUFInstructions.td:Base_MTBUF_Real_gfx6_gfx7_gfx10keeps gfx7'soffset/offen/idxen/glc/op/SLC/TFE positions on GFX10;
MTBUF_Real_gfx10puts the unified format in bits 25:19 and DLC in bit 15.Utils/AMDGPUAsmUtils.cpp:DfmtNfmt2UFmtGFX10(78 pairs, ID = tableindex);
UfmtSymbolicGFX10ID 0x16 isBUF_FMT_32_FLOAT.AMDGPUBaseInfo.cpp:convertDfmtNfmt2Ufmtreturns that index for GFX10.src/hlsl/mtbuf.rs::ufmtalready decodes the same GFX10 IDs from(word >> 19) & 0x7f.What changed:
to_rdna2no longer rejects every gfx7 MTBUF. It:addr64(bit 15), which has no RDNA2 equivalent (bit 15 is DLCon GFX10);
(dfmt, nfmt)to the GFX10 unified ID and writes it to bits 25:19;Unsupported
(dfmt, nfmt)pairs still return an explicit error instead ofguessing.
Tests and results:
cargo test -p tombox-xshader --lib gcn::tests::mtbuf-> 6 passed, 0 failed.cargo test -p tombox-xshader --lib-> 14 passed, 0 failed.cargo build -p tombox-xshader-> exit 0 (only the pre-existingAS_ABI_UNKNOWNdead-code warning).AMDGPUAsmUtils.cppagainst the Rust table ->78/78 entries match, in ID order.
cargo test -p tombox-xshader --no-fail-fast:opcodes22/22 andsynthetic7/7 pass;exec56 passed, 4 failed, 1 ignored. The fourfailures are
vop::basiccases targeted by open PRs #24, #29, #33 and #34.amp,fixturesand the mesh fixture test require privateanalysis/shaders/fixtures that are not present in a public checkout,and are addressed by PR #13;
mesh_refusals_are_explicitis addressed byPR #19. Integration tests do not call
to_rdna2(grep: no matches), sothis diff cannot affect them.
Negative control: with the old unconditional MTBUF rejection restored,
5 of the 6 new tests failed (only the static table-order test passed). After
restoring the conversion, all 6 passed.
Environment: Windows 11 Pro 10.0.26300, rustc/cargo 1.99.1, NVIDIA
RTX 3070 driver 32.0.16.2124.
Proven / inferred / not tested:
the table matches LLVM exactly.
the HLSL backend consumes the same unified IDs.
starting from gfx7 MTBUF (the execution harness constructs RDNA2 ISA
directly).
addr64and format pairs absent from LLVM's GFX10 table remain expliciterrors.
Dependencies: none.
cargo test -p tombox-xshaderpassesUnchecked: the crate has pre-existing failures on this checkout.
amp,fixturesand the mesh fixture test need privateanalysis/shaders/fixtures that are not present in a public checkout;
the
vop::basicfailures are targeted by open PRs #24, #29, #33 and#34;
mesh_refusals_are_explicitis targeted by PR #19. The changedmodule's tests and the crate's
--libtests pass, and the failingintegration tests never call
to_rdna2.No game or console files and no binaries included
No fake success; anything not possible is left
missingwith a noteNo game files, console DLLs, assets or binaries are included.
@omonkeyz on GitHub · 2026-11-22 13:18 UTC · original
Main's history was rewritten, which auto-closed this PR. It is applied in
73c5103(merged in99f48e3) with your authorship kept, thanks! The added comment lines were stripped on the applied copy, and LLVM's DfmtNfmt2UFmtGFX10 table is credited in THIRD_PARTY/CREDITS.Pull request closed