Shaders/Lower: return 6 faces for channel 2 of image_get_resinfo on SQ_RSRC_IMG_CUBE #3010

Open
github-bot wants to merge 1 commit from github-bot/gh-3010 into main AGit
Owner

@⁠RVZO6 on GitHub · 2026-11-26 03:19 UTC · original
RVZO6:rvzo/cube-resinfo-faces → main · +203 −1 · 2 files · 1 commits · open

Lower::image_op (crates/victory-shader/src/emit/lower.rs:8670-8685) previously placed TextureCube (kind == 5) in 2 | 5 | 6 with present[2] = false, returning 1 for channel 2 (depth) of image_get_resinfo on a cubemap.

Per public AMD documentation, compilers, and RDNA 2 hardware measurements:

  • AMD GCN3 ISA (Aug 2016, rev 1.1) §12.16, p. 12-175: "For cubemaps, depth = 6 * Number_of_array_slices."
  • AMD RDNA3 ISA (13 Dec 2022) §10.1, p. 95: "For cubemaps, depth = 6 * Number_of_array_faces. (DX expects the # of cubes, but gets # of faces instead)."
  • Mesa RADV (nir_lower_tex.c) and AMD LLPC (ImageBuilder.cpp) both divide cubemap resinfo depth by 6.
  • Measured on gfx1031 hardware: an 8×8 DIM CUBE T# returns (8, 8, 6, 1).
  • Companion to #1256 (which scales TextureCubeArray, kind == 9, by × 6).

Emit constant 6 when kind == 5 && ch == 2, with tests in crates/victory-shader/src/emit/lower/cube_resinfo_tests.rs (keeping lower.rs at 520,845 B, well under the 512 KiB limit).

Verification

  • cube_image_get_resinfo_reports_six_faces lowers image_get_resinfo dmask:0xf dim:SQ_RSRC_IMG_CUBE, validates with dxil.dll, and executes on WARP SM 6.6 against a 3-mip 8×8 MippedCube, asserting [8, 8, 6, 3] (mip 0) and [4, 4, 6, 3] (mip 1).
  • Official Windows MSVC + WARP SM 6.6 CI (Rust 1.98.1, default + --tests + --features diagnostics clippy, xtask policy, full workspace tests): RVZO6/VIctory CI run #45747688145 (green, combined Wave 9 check on 63bcca4).
  • Not run: the title; any hardware GPU.

AI-assisted: T3 Code (Antigravity, gemini-4-neon).

**@⁠RVZO6** on GitHub · 2026-11-26 03:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/3010) `RVZO6:rvzo/cube-resinfo-faces` → `main` · +203 −1 · 2 files · 1 commits · open `Lower::image_op` (`crates/victory-shader/src/emit/lower.rs:8670-8685`) previously placed `TextureCube` (`kind == 5`) in `2 | 5 | 6` with `present[2] = false`, returning `1` for channel 2 (`depth`) of `image_get_resinfo` on a cubemap. Per public AMD documentation, compilers, and RDNA 2 hardware measurements: - AMD GCN3 ISA (Aug 2016, rev 1.1) §12.16, p. 12-175: *"For cubemaps, depth = 6 * Number_of_array_slices."* - AMD RDNA3 ISA (13 Dec 2022) §10.1, p. 95: *"For cubemaps, depth = 6 * Number_of_array_faces. (DX expects the # of cubes, but gets # of faces instead)."* - Mesa RADV (`nir_lower_tex.c`) and AMD LLPC (`ImageBuilder.cpp`) both divide cubemap `resinfo` depth by 6. - Measured on gfx1031 hardware: an 8×8 `DIM CUBE` T# returns `(8, 8, 6, 1)`. - Companion to #1256 (which scales `TextureCubeArray`, `kind == 9`, by `× 6`). Emit constant `6` when `kind == 5 && ch == 2`, with tests in `crates/victory-shader/src/emit/lower/cube_resinfo_tests.rs` (keeping `lower.rs` at `520,845 B`, well under the 512 KiB limit). ### Verification - `cube_image_get_resinfo_reports_six_faces` lowers `image_get_resinfo dmask:0xf dim:SQ_RSRC_IMG_CUBE`, validates with `dxil.dll`, and executes on **WARP SM 6.6** against a 3-mip 8×8 `MippedCube`, asserting `[8, 8, 6, 3]` (mip 0) and `[4, 4, 6, 3]` (mip 1). - Official Windows MSVC + WARP SM 6.6 CI (Rust 1.98.1, default + `--tests` + `--features diagnostics` clippy, `xtask policy`, full workspace tests): [RVZO6/VIctory CI run #45747688145](https://github.com/RVZO6/VIctory/actions/runs/45747688145) (green, combined Wave 9 check on `63bcca4`). - **Not run:** the title; any hardware GPU. AI-assisted: T3 Code (Antigravity, gemini-4-neon).
Lower::image_op previously placed TextureCube (kind 5) in `2 | 5 | 6`
with `present[2] = false`, emitting constant `1` for channel 2 (depth)
of `image_get_resinfo` on a cubemap.

Per AMD GCN3 ISA §12.16, RDNA3 ISA §10.1, AMD LLPC (ImageBuilder.cpp),
Mesa RADV (nir_lower_tex.c), and gfx1031 hardware measurements
((8, 8, 6, 1) for an 8x8 cube), cubemap `image_get_resinfo` reports
face count (`6` for a single cube; companion to #1256's `× 6` for cube
arrays).

Emit constant `6` when `kind == 5 && ch == 2`, with DXIL validation and
end-to-end WARP SM 6.6 regression tests in `emit/lower/cube_resinfo_tests.rs`.

Assisted-by: T3 Code (Antigravity, gemini-4-neon)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:20:02 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 06:17 UTC · original

Automated triage for the maintainers.

For image_get_resinfo on a cube (DXIL kind 5), Lower::image_op in emit/lower.rs now returns the constant 6 in channel 2 instead of 1. Previously channel 2 counted as "not present" for cubes in the 2 | 5 | 6 arm. The evidence is public: the AMD ISA manuals' rule that a cubemap's depth is 6 times the number of slices, the RADV/LLPC lowering that divides by 6, and a stated gfx1031 (RDNA2) measurement. That is the kind of evidence a semantics change needs. The fix touches only kind 5, and cube arrays (kind 9) are left to #1256. The WARP test in lower/cube_resinfo_tests.rs checks [8, 8, 6, 3] at mip 0 and [4, 4, 6, 3] at mip 1.

Minor: the inline comment's list of citations could be cut to one short reference.

CI: check passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 06:17 UTC · [original](https://github.com/Marvisak/VIctory/pull/3010#issuecomment-7184281621) <!-- victory-triage v1 head=df36af54077e1d131fd6686b2489094ce6b992a1 verdict=merge-candidate at=2026-11-26T06:21:00Z --> Automated triage for the maintainers. For `image_get_resinfo` on a cube (DXIL kind 5), `Lower::image_op` in `emit/lower.rs` now returns the constant 6 in channel 2 instead of 1. Previously channel 2 counted as "not present" for cubes in the `2 | 5 | 6` arm. The evidence is public: the AMD ISA manuals' rule that a cubemap's depth is 6 times the number of slices, the RADV/LLPC lowering that divides by 6, and a stated gfx1031 (RDNA2) measurement. That is the kind of evidence a semantics change needs. The fix touches only kind 5, and cube arrays (kind 9) are left to #1256. The WARP test in `lower/cube_resinfo_tests.rs` checks `[8, 8, 6, 3]` at mip 0 and `[4, 4, 6, 3]` at mip 1. Minor: the inline comment's list of citations could be cut to one short reference. CI: `check` passing. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3010/head:github-bot/gh-3010'
git switch 'github-bot/gh-3010'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3010'
git switch 'github-bot/gh-3010'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3010'
git switch 'github-bot/gh-3010'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3010'
git switch 'main'
git merge --squash 'github-bot/gh-3010'
git switch 'main'
git merge --ff-only 'github-bot/gh-3010'
git switch 'main'
git merge 'github-bot/gh-3010'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!3010
No description provided.