Recompiler: image_get_resinfo on a 1D array gives the layers in y #1266
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1266
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1266/head"
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?
@emirduran707 on GitHub · 2026-11-24 13:59 UTC · original
emirduran707:recomp-resinfo-1d-array-layers→main· +45 −1 · 3 files · 1 commits · merged 2026-11-25 01:05 UTCimage_get_resinfoon a 1D array (DIM 4) returned (width, 1, layers, mips): the layer count went to z and y was 1. On RDNA the layer count of a 1D array is in y. Mesa's AMD driver code shows it:visit_image_sizeinac_nir_to_llvm.cmoves z into y only for GFX9 (chip_class == GFX9 && dim == 1D && is_array). GFX9 is the one chip that maps 1D arrays toac_image_2darray(ac_get_sampler_diminac_shader_util.c). From GFX10 on, the dim isac_image_1darrayand the hardware's x and y are used as they are. Read in Mesa 21.3.9. So a shader reading the element count of aTexture1DArraygot 1.The layer count now goes to y. z keeps the value it had (the layer count), since no source says what z holds for a 1D array, so only y changes.
What is in it
crates/xcl/src/gpu/recomp/emit.rs: the DIM 4 arm ofimage_get_resinfo.crates/xcl/src/gpu/recomp/tests.rs:image_get_resinfo_1d_array_layers_in_y, which needs no GPU and checks that the element count is written into y;gpu_image_get_resinfo_1d_array, with a 4-wide, 3-layer 1D array: x 4, y 3, mips 1.crates/xcl/src/gpu/recomp/runner.rs:TexDim::D1Arrayfor that GPU test (a TEXTURE1D resource with TEXTURE1DARRAY views).Tested
cargo test --workspace -- --test-threads=4oncafda82: 743 passed, 0 failed, 41 ignored; no SKIPPED GPU tests (the new GPU test ran and passed on this adapter)GetDimensions(v3, t1_w, t1_d, t1_n) must write the elements into _h); with it it passesRegression run
main:
this PR:
Not tested
AI use
🤖 Generated with Claude Code
@DavidM1911 on GitHub · 2026-11-24 14:05 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:Thanks!
@thehollowedone on GitHub · 2026-11-24 14:06 UTC · original
Independent RTX 3080 Ti check on
cafda82, Windows 11 build 26300, driver 621.35, Rust 1.99.1 MSVC, DXC 1.8.2502.11, debug.I ran
image_get_resinfoon a synthetic 16-wide, seven-layer 1D array with three partial component masks. On the PR, the layer-only mask (0x2) returned 7, mip-only (0x8) returned 1, and width/layers/mips (0xb) returned packed(16, 7, 1). All 64 lanes matched in each case, including registers seeded to detect unintended writes. Restoring only the parent emitter returned 1 instead of 7 on all 64 lanes for both masks that ask for layers. The mip-only control still passed.Both stock 1D array tests and the added GPU check passed on the PR with no skips. Synthetic workload only. AI-assisted. Codex (GPT-6, exact variant unavailable) wrote and ran the scratch fixture and drafted this report.
@DavidM1911 on GitHub · 2026-11-26 04:40 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin