shader: lower typed gfx1030 2D image mip loads #1258
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1265"
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 R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-24T06:15:12Z.
Scope
Lower gfx1030
image_load_mipfor a caller-declared linear 2DR32G32B32A32_UINTimage. The 32-bit address has three consecutive VGPRs for x, y and mip. In thea16form, the first VGPR holds x and y and the low half of the next VGPR holds mip. Both forms emitTexture2D<uint4>.Load(int3(x, y, mip))for DMASK x, xy, xyz and xyzw. Theimage_loadpath and its descriptor provenance and wait rules are shared with the mip form. The caller supplies in-range coordinates and a matching mip range starting at level zero. This extends #1236 and #1239.The synthetic fixture uploads three separately tagged subresources and uses LOD 0, 1 and 2 within each dispatch. It compares all 320 output words against a CPU reference and covers dispatches of one, two and four groups. The four-channel form aliases the destination with address registers. Rejections cover the wrong tuple width, an unknown LOD VGPR, NSA, TFE and reading the result before
s_waitcnt vmcnt(0).Validation
Tested commit
6e23abc64d8d659c7f5ae57f5ae65ece4a9a1d38on Windows 11 26H2 build 26300.9974. The adapters were Intel Arc B390 with driver 32.0.101.8509 and WARP (Microsoft Basic Render Driver) with driver 10.0.26100.9818. The runner reporteddebug_layer=unavailableon both backends.CTest reported 41 passed, 0 failed and 0 skipped. This run also covered the upstream raw MUBUF vector reads on both backends. Each mip backend ran eight cases and compared 320 words per case with zero mismatches. Forcing LOD zero first failed at
word=32 expected=11000000 actual=10000000in both address families. Reading the packed high half as the LOD first failed atword=0 expected=10000000 actual=00000000. Mutating one written word and one sentinel word also triggered the expected comparisons. The compute fixture executes translated desktop DXIL. The same-run JUnit coverage recordsimage_loadandimage_load_mip, two of 111 gfx1030 MIMG mnemonics indocs/coverage/rdna2.tsvfor this fixture set.LLVM 15.0.7 assembled and decoded all eight mip cases from source on Ubuntu 22.04. The synthetic PSB container CLI emitted the same HLSL as direct text lowering. The disassembly suite ran 133 tests with one skip. The coverage and documentation checks passed.
The experiment notes document the bound SRV and descriptor assumptions.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T06:35:10Z.
Review: COMMENTED
Dual-platform review at commit
b5810ee63ae58e0c919e8e065a6c12ff082540ae:Verification
git diff --check origin/main...HEAD: passedpython -B tests/docs_links_check.py: passed (16 Markdown files, 284 links)python -B tests/bidi_controls_check.py: passed (1064 files)python -B tests/form_coverage_check.py: passedLLVM_LIB=/usr/lib/llvm-19/lib/libLLVM-19.so LLVM_MC=llvm-mc-19 LLVM_OBJCOPY=llvm-objcopy-19 python -B tests/compute_store_check.py binary llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.so: passedLLVM_LIB=/usr/lib/llvm-19/lib/libLLVM-19.so LLVM_MC=llvm-mc-19 LLVM_OBJCOPY=llvm-objcopy-19 python -B tests/rdna2_tools_check.py: 3 failures / 3 errors out of 133 tests (existing LLVM 15 syntax/boundary expectations inrdna2_tools_check.py, unrelated to this PR)--preset dev):cmake --build --preset dev --target offscreen_check -- -j 6+ctest --preset dev -R '^(compute_store_aot_|compute_root_|compute_tables_|offscreen_capability_table_self_test$)' --parallel 4 --no-tests=error --output-on-failure-> 39/39 passed (50.53s, includingcompute_store_aot_mimg_mip_warpandcompute_store_aot_mimg_load_warp)/O2(--preset release):cmake --build --preset release --target offscreen_check -- -j 6+ctest --preset release -R '^(compute_store_aot_|compute_root_|compute_tables_|offscreen_capability_table_self_test$)' --parallel 4 --no-tests=error --output-on-failure-> 39/39 passed (47.55s)Code Notes
tools/compute_store_aot.pycleanly unifiesimage_loadandimage_load_miplowering for both 32-bit(x, y, mip)anda16(packed_xy, mip_lo16)forms, verifying exact VGPR tuple width (len(vaddr) == min(address_words, 2)), contiguous registers,is_wordprovenance, and waitcnt ordering.tests/compute_check.cpppreserves backward compatibility with single-mip.casefiles while loading 3 mip levels (32x8,16x4,8x2) when appended.