gpu: translate image_load_mip on 2D arrays #1410
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1417"
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 tedin7 on 2026-11-24T11:02:24Z.
What
image_load_mipwithdim:SQ_RSRC_IMG_2D_ARRAYis translated toTexture2DArray.Load(int4(x, y, slice, mip))instead of being refused. The change intools/startup/gfx2hlsl.pyremoves the explicit refusal (the method already hadaxes = 3, the address assembly and thelen(cs) == axes + 1check). Cube maps are still refused.Test side:
startup_image_2d_array_check.pygains translation controls and a draw of a two-slice, three-mip array; the shared draw fixture (tests/startup_image_3d.cpp) takes a mip-level count and a new--startup-image-2d-array-mipsoperation intests/offscreen_check.cppuses it.docs/startup-runtime.mdis updated.src/startup_stubs/d3d12_draw.inlis not touched: it copies the view the program recorded (MipLevelsincluded) and only falls back toMipLevels = 1when no view was recorded, so a recorded array view with several mips is bound as recorded.Why
The refusal was not a hardware finding.
3696ec96merged the 2D array change (34f03603) and the explicit mip load change (03f8980b) from separate branches; each had verified only its own dimensions, and the merge refused the unverified combination. The 2D array docs already listed "an array with mip levels in image_load_mip" as not covered. A pixel stage that used it was skipped with every draw through its pipeline.Tested
Run locally on Linux:
python3 -B tests/startup_image_2d_array_check.py(translation controls, refusals, mutant model),tests/startup_image_3d_check.py,tests/startup_image_load_mip_check.py,tests/startup_image_sample_l_check.py,tests/docs_links_check.py,tests/bidi_controls_check.py,git diff --check: pass.python3 -B tests/startup_image_2d_array_check.py binary llvm-mc-19 mip: the new fixture words (packed and NSA address) match llvm-mc 19 for gfx1013.binary llvm-mc-15(what CI runs) is unchanged and passes without the new fixtures.check_draw_mips) was exercised with a stand-in compiler and renderer that evaluate the translated Load: all 6 (fixture, slice) cases and all 7 mutants behave as expected. This proves the Python driver and the mutant strings, not D3D.tests/startup_image_3d.cppcompiles (-fsyntax-only, mingw g++ C++20).Windows (not run here):
(ctest names:
startup_image_2d_array_controls,startup_image_2d_array_warp,startup_image_2d_array_hardware; no new ctest entries, CI and CMake registration unchanged.)Not run locally: D3D12, WARP, DXC, FXC, MSVC,
offscreen_check.cppcompilation (needs generated headers), LLVM 15.Unverified
image_load_miponSQ_RSRC_IMG_2D_ARRAYonly with four address registers (three are rejected: "image address size does not match dim and a16"), and the 3D form (x, y, z, mip) andimage_sample_l(coordinates, then level) already use the same coordinates-then-level order. Not established: that hardware reads slice before mip rather than the reverse; the draw test would show a swap on a real adapter.mipargument, and CI does not pass it. The encoded words are pinned.mip one too highreads another valid cell by construction (no out-of-range load is relied on).Left out
Cube maps (
image_load_mipwithSQ_RSRC_IMG_CUBE) are still refused with the same message ("image dimension SQ_RSRC_IMG_CUBE"); only a 2D array is added here.AI-assisted (Claude Code); commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T11:06:36Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
77d7a36c:--preset dev):ctest --preset dev -R '^startup_image_2d_array_' --no-tests=error --output-on-failure— 3/3 passed (startup_image_2d_array_controls0.22s,startup_image_2d_array_warp3.49s,startup_image_2d_array_hardware3.49s on WARP VM)/O2(--preset release):ctest --preset release -R '^startup_image_2d_array_' --no-tests=error --output-on-failure— 3/3 passed (startup_image_2d_array_controls0.20s,startup_image_2d_array_warp3.38s,startup_image_2d_array_hardware3.40s on WARP VM)Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T11:06:43Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
77d7a36ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.