Shaders: decode cube-array slice and face in image lowering #1256
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1256
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1256"
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?
@fuzeofficlal on GitHub · 2026-11-24 16:49 UTC · original
fuzeofficlal:fix/cubemap-array-sampling-720→main· +1174 −40 · 4 files · 1 commits · openFixes #720.
Summary
RDNA2
MIMGcarries no separate dimension bit for cube-map arrays (dim:CUBE= 3 is shared byTextureCubeandTextureCubeArray): the compiler packs the third coordinate operand as8 * slice + faceand expects channel 2 ofimage_get_resinfoto report the view's face count (NumCubes * 6).TextureCubeArray(DXIL kind 9) when adim == 3sample orgather4builds its face operand by multiplying by8.0(covering literal, inline,omod, SGPR/VGPR constant sources, anda16half-float coordinates) or from a constant>= 8.0, whenimage_get_resinfohas a live channel-2 read, or when another cube site shares the same descriptor slot. PlainTextureCubesites remain kind 5.idx & 7with unsigned clamping of face IDs6and7to face5(-Z), and passfloat(idx >> 3)as the fourth sampling coordinate while keeping integer texel offsetsundeffor kind 9.image_get_resinfochannel 2 by 6 onTextureCubeArrayhandles so D3D12's cube count matches RDNA2's face count.Verification
dxil.dllvalidation tests acrossimage_sample*(_lz,_l,_b,_c_lz,a16),image_gather4_lz, and standalone / descriptor-linkedimage_get_resinfo.0..8including6, 7 -> 5clamping,gather4,resinfo, and plainTextureCubenon-regression) executed across:cargo clippy --workspace --all-targets --all-features --locked -- -D warningsandcargo xtask policypass.@pablogonz12 on GitHub · 2026-11-24 17:03 UTC · original
Setup: Linux, RX 9070 XT, RADV (Mesa 26.3.1), dxil-spirv master, spirv-val 1.3. Your head folded onto a base of origin/main
ffe310eplus #1017 — main's host build is broken without it (E0425 host_resourceinvictory-gpu), so the base is that pair. Ran the four-stage offline check (translate, dxil-spirv, spirv-val, RADV pipeline) over 768 programs: the 751-program world dump plus a 52-program BVH capture, 35 duplicate containers skipped.No program gained or lost and the failure table is identical to the base, reason for reason: nothing in this capture reaches the class you lower, so this is a no-regression result only (same 10 SPIR-V validation failures as the base).
Not tested: in-game.
@Marvisak on GitHub · 2026-11-25 01:20 UTC · original · edited 2026-11-26 01:18 UTC
Automated triage for the maintainers.
Merge candidate (kept). The new head (
e516804) is the same change as one commit on currentmain, and it merges cleanly. The inference now lives in its own module,emit/lower/cube_array.rs(cube_arrays).The behaviour is unchanged from the last review. A
dim == 3site becomesTextureCubeArray(kind 9) when its face operand is8 × slice + face, a constant of at least 8, or a live resinfo channel 2, or when it shares a descriptor with such a site.cube_directionsplits the operand intoidx & 7andidx >> 3, and resinfo channel 2 is scaled by 6. A plain cube still lowers as kind 5.One more thing in the new head: cube gathers with an offset are now refused (
"a cube gather with an offset"). The clamp of face ids 6 and 7 to face 5 still has no stated hardware reference. It would be welcome, but it doesn't block.CI: passing (
check). Recommending a look, not approving.Generated by Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.