shader: lower indexed gfx1030 formatted UINT buffer loads #1290
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1297"
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:11:09Z.
Change
Lower
buffer_load_format_x,buffer_load_format_xy,buffer_load_format_xyz, andbuffer_load_format_xyzwin the gfx1030 compute store profile. The caller uses--source-format BUF_FMT_32_32_32_32_UINTto declare the format and identity XYZW selectors of the bound source descriptor. The synthetic fixture binds the corresponding bytes at rawt0. Each load copies the requested prefix of the texel in channel order with its full UINT representation.The supported subset uses a verified
idxendispatch-thread index, zero scalar offset, and 16-byte-aligned stride and instruction offset. A complete texel must fit within a source record. The source is stable, unswizzled, in range, and disjoint from the output, with add-thread-ID disabled. The descriptor and destination registers require their existing waits. Other channel mappings, D16 and status forms, and native descriptor bounds are outside this profile. Format and selector ownership follows section 8.1.4 of the AMD RDNA 2 Shader ISA.Follow-up to merged #1254 and #1282. Replayed on upstream main at
b1e812ccf774fe67d27e84c785ff6429f0aaf7b7, which includes the raw subword stores from #1288.Verification
Tested clean head
c05767dd56b7f4b9d2cb20784462b827d57e1e54.40 passed, 0 failed, 0 skipped. Both
compute_store_aot_mubuf_format_{hardware,warp}tests recorded the four new gfx1030 forms. Windows build 26300.9974, Intel Arc B390 (32.0.101.8509) and Microsoft Basic Render Driver/WARP (10.0.26100.9818). The debug layer was unavailable on both. A CPU reference compared all 320 words for one and two groups, including the untouched gaps and tail. Forbuffer_load_format_x, selecting Y first differed at word 0 with8b02a7f1expected and8b06bba2actual. For XY, XYZ and XYZW, swapping the first and last channels also first differed at word 0. Rejection controls cover missing format or waits, bad operands, and partial or misaligned source records. The rejection for a read exactly at the next record isRead leaves its source element.Passed on Ubuntu 22.04.5 with LLVM 15.0.7. All four original wave32 fixtures assemble and decode, and the synthetic container CLI emits the same HLSL as direct lowering. The GPU fixtures execute translated desktop DXIL. The Markdown link and coverage self-tests passed.
Both simulated landing orders with #1288 before its merge produced the same tree. The combined source passed the LLVM round-trip and the formatted load and raw subword store fixtures on both backends. The final replay and regression above use the merged upstream baseline. A pre-publication merge against main
924e414b920d2b85c5dd0eba70dcac9ca0dfb7e9produced tree31b8f301320824f3cfeddb645f2fa62ccdfc318cwithout conflicts.The source-built fixtures use the repository's MIT License. This change was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T07:17:45Z.
Review: COMMENTED
Reviewed at commit
c05767dd56b7f4b9d2cb20784462b827d57e1e54.Linux Checks
git diff --check origin/main...HEAD: passed./root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py: passed (Checked 16 Markdown files and 290 links.)./root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py: passed (Checked 1083 tracked source, script and build/CI files: no bidirectional controls.)./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 (includingmubuf_format_controlsandbuffer_load_format_{x,xy,xyz,xyzw}assembly/disassembly/container comparison).Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP)
--preset dev):cmake --build --preset dev --target offscreen_check -- -j 6(2.81s, configure1.53s)ctest --preset dev -R '^compute_store_aot_mubuf_format_' --parallel 4 --no-tests=error --output-on-failure: 2/2 passed (3.22s:compute_store_aot_mubuf_format_hardware3.13s,compute_store_aot_mubuf_format_warp3.14s)/O2(--preset release):cmake --build --preset release --target offscreen_check -- -j 6(0.36s, configure1.53s)ctest --preset release -R '^compute_store_aot_mubuf_format_' --parallel 4 --no-tests=error --output-on-failure: 2/2 passed (3.15s:compute_store_aot_mubuf_format_hardware3.06s,compute_store_aot_mubuf_format_warp3.07s)Code Review Notes
tools/compute_store_aot.py: cleanly enforcescpu == "gfx1030",idxen and not offen,source_stride % 16 == 0, 16-byte offset alignment, andoffset + 16 <= source_stride(full texel bounds check even for 1–3 channel loads).tests/compute_store_check.py: covers 1–4 channel loads with index/destination aliasing (v8), 1- and 2-group dispatches against the CPU reference, wrong-channel mismatch controls, and rejection controls for missing/unsupported--source-format, non-16-byte stride/offset,offen, scalar offset,tfe,d16_, UAV aliasing, and missinglgkmcnt(0)/vmcnt(0)waits.