shader: translate packed D16 image stores in startup compute programs #2292
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2300"
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 RavenCurseBurg on 2026-11-25T10:49:35Z.
Refs #2274, item A, compute
image_store d16. At25317c63the startup compute translator refuses the source-built shader from #2106 withimage_store outside a pixel stage.The new path accepts a 2D full-RGBA-mask store with full-width XY and an intact eight-word descriptor from a fixed table location. It unpacks the low/high half-floats of VDATA and VDATA+1 into RGBA and writes under the lane's EXEC bit. The layout comes from the AMD RDNA 2 ISA, §§8.2.1 and 8.2.5.
The shared interface with item B is the version 2 compute manifest line
uav N tex2d float table P O channels 4. For the fixture it names table 1, byte 64. The translator assigns a single UAV index space to raw and typed views. Tests cover both discovery orders, conflicting raw/typed stores and conflicting SRV/UAV uses of the same descriptor. The standalone test supplies an RGBA16_FLOAT UAV. Slot-67 binding and its view-format checks remain with the runtime item.Verification
python -B tests/startup_compute_image_store_d16_check.py --dispatch <dxc> <offscreen_check> warpand the same command withhardwareran on Windows build 26100.9711, WARP 10.0.26100.9711 and a desktop RTX 4060 with driver 32.0.15.9579. Both positive cases matched all 1,344 halves on each adapter. The four controls removing the store, swapping R/G, swapping the packed registers and dropping EXEC protection differed in exactly 64, 32, 64 and 32 halves. The first three showed5000,c000and0000at mip 0, half 0 (expected3c00). The fourth showed3c08at half 128 (expected5080). The local debug layer was unavailable.python -B tools/startup/gfx2hlsl.py --pending <cache>path processed synthetic request keysd3cfb5c33473af1fand1bd251f34165a64e. Both manifests and HLSL matched the direct translator. All four dispatches of the CLI-produced CSOs matched 1,344/1,344 halves.tools/run_checks_parallel.py(startup D16 store, compute, gather, pixel store, compute translation, offline D16 store, docs links and bidi controls). All 51tests/startup_gfx2hlsl*_check.pyentries passed. The original offline D16 WARP draw also passed, including its two existing negative controls.git diff --checkpassed.To repeat the registered checks, build
offscreen_checkand runctest --preset release --no-tests=error -R '^startup_compute_image_store_d16' -V. The input shader and CPU oracle are the repository's MIT-licensed synthetic fixtures. AI-assisted with Codex.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T10:53:16Z.
Review: COMMENTED
Review of head
43822328746ab6eee06cca1349187f274018c03b.Result: no P1, no P2.
Checked:
op_image_storematches the cited layout: RG in VDATA, BA in VDATA+1, low half first. Full dmask, exactly two VGPRs, full-width VGPR XY and an intact fixed-table 8-word descriptor are all enforced. Other compute stores are refused.fixed_table_imageis a pure refactor forgather4. Its tests still pass.Commands run locally, with results:
python3 -B tests/startup_compute_image_store_d16_check.py: passed.python3 -B tests/startup_gfx2hlsl_compute_check.py: passed.python3 -B tests/compute_mimg_float_store_d16_check.py: passed.python3 tests/docs_links_check.py: passed, 438 links.python3 tests/bidi_controls_check.py: passed.git diff --check origin/main...HEAD: clean.if (exec & 1)guard (this edit hit 3 emit sites). The test failed on the EXEC guard assertion.git checkout -- ..Nits:
--dispatch ... warp) is where the half order and EXEC are checked numerically. I did not re-run it, because the PR body lists its own Windows verification and the Windows CI job was still pending. Please make sure that job is green before Ready.fixed_table_imagerejects a descriptor whose words were modified. A short comment saying that the manifest binds the original table view would help the next reader. The old comment was dropped in the refactor.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T11:00:56Z.
The final-head Windows 2025 run passed all four CTests at
c091eed7: startup D16 host controls, startup D16 WARP, the offline D16 WARP fixture and the typed UAV-load WARP fixture. The startup dispatch executed both positive cases and all four negative controls. Each compared 1,344 halves with the predicted mismatch count and reporteddebug_errors=0 debug_warnings=0with the debug layer enabled. All three standard upstream jobs also passed at this head.The first debug-layer run matched all 1,344 halves but reported warning 989 from the texture fixture's legacy format capability query. The follow-up uses the repository's SDK-version-aware
check_featurehelper for the format and additional typed-load queries. It also explains why an alias modification invalidates the original table view even if the eight SGPR symbols still look intact.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T11:07:44Z.
Review: COMMENTED
Re-review of head
c091eed70d1906b968be2b2ec37c6417561fb734(previously reviewed at43822328).Result: no P1, no P2.
What changed since the last review:
tests/compute_check.cpp:547,551: the two texture-store capability queries (D3D12_FEATURE_FORMAT_SUPPORT,D3D12_FEATURE_D3D12_OPTIONS) now go through the sharedcheck_feature()helper (declared intests/desktop_gpu.h, defined intests/desktop_gpu.cpp:18, already included). Same queries, now made against the selected Agility SDK device. No logic change.tools/startup/gfx2hlsl.pyfixed_table_image: the docstring is reworded, and a comment now explains that a write through a second load of the descriptor can leave the SGPR symbols intact. This addresses my earlier nit about the dropped comment. Comment and docstring only.Checked:
Commands run locally, with results:
python3 -B tests/startup_compute_image_store_d16_check.py: passed.python3 -B tests/startup_gfx2hlsl_compute_check.py: passed.python3 -B tests/compute_mimg_float_store_d16_check.py: passed.python3 tests/docs_links_check.py: passed, 438 links.python3 tests/bidi_controls_check.py: passed.git diff --check origin/main...HEAD: clean.first[3] % 8to% 4infixed_table_image. The D16 check failed with an AssertionError on the expected refusal text. Reverted withgit checkout -- ..Nits: none new. The WARP readback is covered by the Windows CI job, which is green. I did not re-run Win2025, since the new commit does not touch the translated HLSL.
AI-assisted; commands listed were executed locally.
upstream-sync referenced this pull request2026-11-25 12:01:50 +00:00