Repository navigation
rdna2spirv: translate image_get_lod on a cube (IMAGE-GET-LOD-CUBE) - #2099
Conversation
A cube binds as the 6-layer 2D-array view cube_coords already builds for image_sample: the query takes the projected s - 1 and t - 1 (the 2D-array u and v) and does not read the third word (8 * slice + face). a16 packs the three coordinates differently, so a16 cube stays Unsupported. No corpus shader uses cube image_get_lod (705 in the 26,503-shader set: 702 2D, 3 2D array), so no title output changes; a 2,651-shader shard translates to byte-identical .spv before and after. Confirmed by the RDNA2 ISA MIMG GET_LOD form and the existing cube sample mapping (docs/design.md). Tests: tests/semantic/test_image_get_lod_cube.py 5/5 (shape, source VGPRs, face word unread, refusals, spirv-val); full tests/semantic 6,317 tests pass. AI-assisted.
|
Tested
The counts are identical to AI-assisted (Claude Code). No game data. |
aslan2142
left a comment
There was a problem hiding this comment.
Draft review note: cube image_get_lod lowering (IMAGE-GET-LOD-CUBE) is cleanly scoped and currently mergeable on main, but remains a draft with no CI run. Please run CI to green and mark ready for review when you want this merged.
(AI-assisted review.)
|
Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review. (AI-assisted triage.) |
aslan2142
left a comment
There was a problem hiding this comment.
Now ready for review and MERGEABLE. Clean-room verified: cube image_get_lod lowering in tools/rdna2spirv.py, docs/design.md contract update, and tests/semantic/test_image_get_lod_cube.py are clean and GPU-verified on Apple M3 (@Tauwni).
Approving — ready to merge once CI runs green on current main.
(AI-assisted review.)
|
Verified all three result masks for cube LOD with AI-assisted with OpenAI Codex. |
A cube binds as the 6-layer 2D-array view
cube_coordsalready builds forimage_sample: the query takes the projecteds - 1andt - 1(the 2D-array u and v) and does not read the third word (8 * slice + face).a16packs the three coordinates differently, so a16 cube staysUnsupported.No corpus shader uses cube
image_get_lod(705 in the 26,503-shader set: 702 2D, 3 2D array), so no title output changes; a 2,651-shader shard translates to byte-identical.spvbefore and after. Confirmed by the RDNA2 ISA MIMG GET_LOD form and the existing cube sample mapping (docs/design.md).Claimed in the coordination issue as:
IMAGE-GET-LOD-CUBE(#1608).What and why
tools/rdna2spirv.pyrefusedimage_get_lodon every dimension but 2D and 2D array. A cube is the same 6-layer 2D-array viewcube_coordsuses: the hardwaresandtare the projected coordinates in [1, 2] and the third word is 8 * slice + face; the LOD comes from the s/t derivatives, so the translator queriesOpImageQueryLodon%simg2daat(s - 1, t - 1)and does not read the face word. This translation is byte-identical for the existing 2D and 2D-array uses.a16cube remains refused because a16 packs the three coordinates differently.Tested
tests/semantic/test_image_get_lod_cube.py: 5/5 (SPIR-V shape, source VGPRs, face word unread, refusals,spirv-as/spirv-val).tests/semantic: 6,317 tests pass.image_get_lodin the 26,503-shader set (702 2D, 3 2D array); a 2,651-shader shard translated to byte-identical.spvbefore and after.GPUs tested: n/a (translator-only; CPU and
spirv-as/spirv-val, no GPU needed).AI-assisted: yes.
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.