shader: lower packed gfx1030 2D image loads #1314
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1321"
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-24T07:59:05Z.
Scope
Lower
image_load_pck,image_load_pck_sgn,image_load_mip_pckandimage_load_mip_pck_sgnin the gfx1030 compute translator. The caller binds a linear RGBA8 UINT 2D image with an identity channel mapping and a zero base mip. The UINT SRV supplies zero-extended bytes and the_sgnforms sign-extend from bit 7. The four opcodes share the existing 32-bit anda16address paths, DMASK packing, descriptor provenance and waits. This follows #1265 and #1310.Validation
Tested
580299daedc3ac6d80c6b2be5e398c57ab493dabon Windows 11 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. Both reporteddebug_layer=unavailable.CTest reported 47 passed, 0 failed and 0 skipped. Each backend executed 24 packed load cases across four opcodes, two address widths and three DMASKs with one, two and four groups. The fixture checked all 320 words against a CPU reference, including untouched output. Replacing sign extension with zero extension first differed at
word=0 expected=ffffff80 actual=00000080. The reverse mutation produced the reverse mismatch. Fixing the mip level to zero first differed atword=32 expected=0000009d actual=00000080for unsigned loads. Both adapters detected both errors. The fixture also checks refusal of a mismatched format,d16and missing waits. The JUnit-backed gfx1030 compute coverage includes all four new MIMG mnemonics and the two existing typed reads.LLVM 15 assembled and decoded the 24 packed load variants. The synthetic-container CLI emitted the same HLSL as the text path, and the GPU tests executed the translated desktop DXIL.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T08:06:31Z.
Review: COMMENTED
Reviewed and verified PR #1321 at commit
580299daedc3ac6d80c6b2be5e398c57ab493dab(looks good; no blockers).Linux Checks (
/tmp/rev-x2w-1321)git diff --check origin/main...HEAD: passed/root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py: passed (16 Markdown files, 290 links)/root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py: passed (1093 tracked files)/root/.local/share/x2w-rev-venv/bin/python -B tests/compute_store_check.py binary llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.so: passed (includingmimg_packed_controls()and 24mimg_packed_cases()LLVM-19 assembly/lowering checks)Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP)
--preset dev):cmake --build --preset dev --target offscreen_check -- -j 6):20.96sctest --preset dev -R '^(compute_store_aot_mimg_packed_warp|compute_store_aot_mimg_load_warp)$' --parallel 4 --no-tests=error --output-on-failure): 2/2 passed (compute_store_aot_mimg_packed_warp4.78s,compute_store_aot_mimg_load_warp5.43s)/O2(--preset release):cmake --build --preset release --target offscreen_check -- -j 6):22.25sctest --preset release -R '^(compute_store_aot_mimg_packed_warp|compute_store_aot_mimg_load_warp)$' --parallel 4 --no-tests=error --output-on-failure): 2/2 passed (compute_store_aot_mimg_packed_warp5.05s,compute_store_aot_mimg_load_warp5.61s)Notes
tools/compute_store_aot.pyenforces_pck<->R8G8B8A8_UINTmatching and lowers_sgnvia per-componentasuint(asint(image_load_N << 24u) >> 24u)sign-extension from bit 7.tests/compute_store_check.pycovers all four opcodes (image_load_pck,image_load_pck_sgn,image_load_mip_pck,image_load_mip_pck_sgn) across 32-bit anda16addresses,dmask0x1/0xa/0xf, negative lowering controls, and HLSL mutant detection (wrong extensionandfixed LOD).