Shaders: decode cube-array slice and face in image lowering #2522
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!2522
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2522"
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-29 13:49 UTC · original
fuzeofficlal:fix/shader-cube-array→main· +1166 −40 · 5 files · 1 commits · merged 2026-11-30 14:12 UTCSummary
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) incrates/victory-shader/src/emit/lower/cube_array.rswhen 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), passfloat(idx >> 3)as the fourth sampling coordinate while keeping integer texel offsetsundeffor kind 9, and refuse cube gathers with offsets.image_get_resinfochannel 2 by 6 onTextureCubeArrayhandles so D3D12's cube count matches RDNA2's face count.Verification
cargo test --locked -p victory-shader --lib emit::lower::cube_array::— pass (DXIL validated withdxil.dllacrossimage_sample*,a16,image_sample_b, and descriptor-linkedimage_get_resinfo).cargo test --locked -p victory-shader --lib emit::valu_tests::cube_ -- --test-threads=1— 3/3 pass across RTX 5090, AMD Radeon Graphics, and D3D12 WARP (2-cubeand3-cubearrays, face IDs0..8,gather4,resinfo, and plainTextureCubenon-regression).cargo clippy --locked -p victory-shader --all-targets— 0 new warnings in touched files.cargo run --quiet --locked -p xtask -- policy --staged— pass.