startup: gfx2hlsl refuses cube image sampling (dim:SQ_RSRC_IMG_CUBE) #2943
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows#2943
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?
@pigalot on GitHub · 2026-11-26 22:31 UTC · original
tools/startup/gfx2hlsl.pyrefuses an image instruction whose dimension isSQ_RSRC_IMG_CUBEwithimage dimension SQ_RSRC_IMG_CUBE(thekindstable in the image lowering takes 1D, 2D, 3D and 2D arrayonly). So a pixel shader that samples a cube map has no translation, and the draw falls back.
On GFX10 a cube sample is a
v_cubeid/sc/tc/ma_f32sequence (already lowered, after LLVM'sConstantFoldAMDGCNCubeIntrinsic) followed byimage_sample*withdim:SQ_RSRC_IMG_CUBE. The addressholds face-relative coordinates and the face index.
What a lowering would need:
TextureCube<float4>and write manifest kindtexcubefor the binding. The runtime side thatbinds a
TEXTURECUBEview for that kind is in #2938.the
v_cube*sequence), thenSample/SampleLevel/SampleBiasas the 2D forms do.TextureCubedraw, on WARP andhardware, plus a negative control (for example, a face index off by one).
Seen in a local run: slot 70 sees hundreds of
TEXTURECUBEview calls per600 s, on 6-slice 2D arrays in the 4 KiB standard layout (
0x105), in BC1, BC6H, BC7 and BGRA8 formats.This issue was AI-assisted.
@legacy-code-archaeologist on GitHub · 2026-11-26 23:22 UTC · original
I'm working on this one: a gfx2hlsl lowering of
image_sample,_lz,_land_bondim:SQ_RSRC_IMG_CUBEtoTextureCube<float4>, with the direction rebuilt from (s, t, face) as Mesa'sprepare_cube_coordsbuilds them (s = sc/|ma| + 1.5). It writes thetexcubemanifest kind, so it pairs with #2938; I'll open it as a draft that should land after #2938, since main still parses an unknown kind as a buffer.The fixture draws a six-face TextureCube on WARP and hardware from literal (s, t, face) addresses, with face-index and helper-row mutants and a
v_cubechain per face compared with a desktop TextureCube draw. Loads,image_sample_d,image_get_lod, a16/d16, compute stages and samplers withDISABLE_CUBE_WRAPstay refused.AI-assisted.