Repository navigation
feat(shader): accept the dlc cache bit on MIMG - #497
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
c5734d2 to
6dd5a61
Compare
|
Rebased on current main, and one change found while measuring the float image atomics: on the HW, image atomics with |
|
Thanks. The masks are right: llvm-mc puts MIMG Setting
|
What
MIMG instructions other than the atomics now accept the
dlccache bit (word0 bit 7): loads, stores, sample, gather, resinfo. Before this, the decoder threwunsupported or reserved MIMG control bitson any MIMG instruction withdlcset. The modifier sweep over decoded opcodes found it.glcandslcon MIMG already pass onmain.dlcis the RDNA device-level cache policy bit. On image loads, stores and sampling it changes no result, so the decoder only stops rejecting it there and records it ininstruction.dlc, as FLAT/MUBUF do. Image atomics withdlcstill throw (see below). The other reserved bits (word0 bits 6, 14, 16 and 17, plus bit 12 on sample and gather ops; word1 bits 26-29) still throw.Encoding checked with
llvm-mc -mcpu=gfx1013 -show-encoding:image_load ... dlc=0xf0000f80(bit 7),image_sample ... dlc=0xf0800f80.Behaviour measured on HW
The two test kernels ran on a Radeon 660M (gfx1035, same MIMG encoding as gfx1013) over 32 lanes:
image_storewithdlcand withglc slc dlc, each read back through a returning atomic. Edge rows: 0, 1, 5,0x7fffffff,0x80000000,0xffffffff.image_samplewithdlcand withglc slc dlc,image_gather4 dlc,image_get_resinfo dlc,image_sample_l dlcandimage_load dlc.All rows match a model where
dlcchanges nothing, with the texture in fine-grained and in coarse-grained GPU memory.Image atomics with
dlcdepend on the memory: on fine-grained memory they apply normally, but on coarse-grained memory (VRAM)image_atomic_{add,swap,cmpswap,smax}withdlcand withoutslcare dropped (memory unchanged, wrong return), whileslc dlcapplies. Buffer and global atomics withdlcapply on both. The PS5's gfx1013 can't be measured here, so the decoder keeps refusingdlcon the image atomics.Tested
Arch Linux, RADV (Radeon 660M) plus lavapipe (local Mesa and the CI version, Ubuntu Mesa 25.2.8). New execution test
ImageCacheBitsruns the same two kernels and compares every result with the HW rows, then checks thatimage_atomic_add glc dlc,image_atomic_swap dlcandimage_atomic_cmpswap glc dlcare refused.Negative checks: putting
dlcback into either reserved mask (sample/gather or loads/stores) makes the test fail with the old decoder error; dropping it from the atomic mask makes the refusal check fail.Full Release build plus
ctest: everything passes exceptagc_driver_pixel_helper_lanes, which also fails onmainon local RADV since #305.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)