mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:20:53 +01:00
[PR #2099] rdna2spirv: translate image_get_lod on a cube (IMAGE-GET-LOD-CUBE) #2104
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2104
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2099
Author: @BubsMcgee
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:rt-image-get-lod-cube📝 Commits (1)
1b2720brdna2spirv: translate image_get_lod on a cube (IMAGE-GET-LOD-CUBE)📊 Changes
3 files changed (+112 additions, -5 deletions)
View changed files
📝
docs/design.md(+1 -1)➕
tests/semantic/test_image_get_lod_cube.py(+91 -0)📝
tools/rdna2spirv.py(+20 -4)📄 Description
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(ubiquitarianism/leonida#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.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.