docs(debt): measure the image store DST_SEL rule on RDNA2 #18595
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18595"
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?
Imported from boykopovar/AnyPS5. Originally posted by angrysandhill on 2026-11-11T22:31:00Z.
What
A measurement; no code changes. The
StoreTexeldebt entry recorded one hardware data point: with DST_SEL X,Y,Z,W, gfx1035 writes channel 1 of a two-channel format from the W slot (#944; #8282 saw the same on gfx1010). This replaces it with the rule measured on RDNA2 (gfx1031) over every DST_SEL tuple and DMASK, and adds a second entry for one- and four-channel formats.The recompiler fills each texel channel from the lowest data slot whose DST_SEL names it. The hardware does not invert the swizzle that way. It picks the channels by a fixed rule per channel count, reading absent DMASK components as 0:
Two-channel formats read DST_SEL X, Y and Z only. "Channel" means X, Y, Z or W; "constant" means 0 or 1.
So X,Y,Z,W stores (x, w) where the recompiler stores (x, y). X,Y,0,1, Y,X,0,1 and X,X,X,Y agree with the recompiler.
One-channel formats store x when DST_SEL X is X, and w otherwise.
Four-channel formats:
0xff,0xffff,0x3c00,0x3f800000, 1).32_32_32_UINT: a store to a linear T# writes nothing.Not fixed here: a fix needs the format's channel count at the store, which
ImageResource, the image specialization constants and image table accesses don't carry. That is a separate change.Tested
Setup: AMD Radeon RX 6750 XT (gfx1031), AMD Software Adrenalin 26.10.1 (driver 32.0.21045.16010), Windows 10 22H2. Hardware oracle through HIP, wave32, IEEE 0, DX10_CLAMP 1, f32 and f16 denormals kept, round to nearest even, FP16_OVFL 0.
Method:
SW_MODE0) one-row 2D T# (TYPE 9, width 2048), built in SGPRs over the oracle'sextrabytes, which are filled with0xcd.image_store ... dim:SQ_RSRC_IMG_2D unorm glc, one texel per DST_SEL tuple and DMASK, withs_mov_b32changing T# word 3 between stores.(0x11, 0x22, 0x33, 0x44);(2.0, 3.0, 4.0, 5.0)for FLOAT;(0.1, 0.2, 0.3, 0.4)for UNORM and SNORM.s_waitcnt_vscnt,buffer_gl0_invandbuffer_gl1_inv, every lane reads 64 bytes back withglc dlcglobal loads.Formats:
Result: the rules above predict all 505,440 stores in the 26 formats, and no texel kept a fill byte. In 32_32_32_UINT every texel kept its fill bytes.
The recompiler's side:
HW_ORACLE_RUNTIME=vulkanwrites nothing, because the runner doesn't back a descriptor built in SGPRs at run time.agc_driver_image_store_sintinstead: with itsSwizzleOfchanged locally to return X,Y,Z,W for the two-channel formats, the test still passes on this card. Its expected values take channel 1 from the Y slot. So the recompiler stores (x, y) where gfx1031 stores (x, w). That change is not part of this PR.main. The other agreeing cells are read fromStoreTexel's code: Y,X,0,1 and X,X,X,Y on two channels, Z,Y,X,W on four, and one-channel DST_SEL with X=X.Checks:
tools/check_conventions.py: passed. Both entries are under 1,000 characters.git diff --check: clean.Overlap:
StoreTexelline, so the two conflict textually; the resolution keeps both.Not measured: the PS5's gfx1013; tiled swizzle modes (every row used a linear T#); three-channel formats other than 32_32_32_UINT; SRGB and SCALED formats; the other image dimensions;
image_store_mipand D16 stores.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code