Shaders/Lower: return 6 faces for channel 2 of image_get_resinfo on SQ_RSRC_IMG_CUBE #3008
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3010"
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?
Imported from Marvisak/VIctory. Originally posted by RVZO6 on 2026-11-26T03:19:31Z.
Lower::image_op(crates/victory-shader/src/emit/lower.rs:8670-8685) previously placedTextureCube(kind == 5) in2 | 5 | 6withpresent[2] = false, returning1for channel 2 (depth) ofimage_get_resinfoon a cubemap.Per public AMD documentation, compilers, and RDNA 2 hardware measurements:
nir_lower_tex.c) and AMD LLPC (ImageBuilder.cpp) both divide cubemapresinfodepth by 6.DIM CUBET# returns(8, 8, 6, 1).TextureCubeArray,kind == 9, by× 6).Emit constant
6whenkind == 5 && ch == 2, with tests incrates/victory-shader/src/emit/lower/cube_resinfo_tests.rs(keepinglower.rsat520,845 B, well under the 512 KiB limit).Verification
cube_image_get_resinfo_reports_six_faceslowersimage_get_resinfo dmask:0xf dim:SQ_RSRC_IMG_CUBE, validates withdxil.dll, and executes on WARP SM 6.6 against a 3-mip 8×8MippedCube, asserting[8, 8, 6, 3](mip 0) and[4, 4, 6, 3](mip 1).--tests+--features diagnosticsclippy,xtask policy, full workspace tests): RVZO6/VIctory CI run #45747688145 (green, combined Wave 9 check on63bcca4).AI-assisted: T3 Code (Antigravity, gemini-4-neon).
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T03:31:30Z.
Review: APPROVED
Tested merged onto
origin/main(63bcca4) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + WARP,dxil.dllvalidator active):cargo test -p victory-shader --lib cube_resinfo: 2 passed, 0 failed (cube_resinfo_dxil_validatesandcube_image_get_resinfo_reports_six_facespass on RTX 5090 hardware and WARP).cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: 192 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T03:38:38Z.
Review: CHANGES_REQUESTED
Code review on
df36af54(static source inspection; no runtime GPU/DXIL validation executed):6for channel 2 onSQ_RSRC_IMG_CUBEmisreportsTextureCubeArrayviews (crates/victory-shader/src/emit/lower.rs:8681-8684,crates/victory-gpu/src/descriptor/host.rs:1118, 1498):SQ_RSRC_IMG_CUBE(dim == 3,kind == 5) for both single cubemaps and cubemap arrays (descriptor/host.rs:1118maps bothTextureCubeandTextureCubeArrayto cube descriptors while preserving the D3D12 SRV dimension).self.s.m.i32(6)unconditionally forkind == 5 && ch == 2reports6even for a multi-cube array (e.g., 2 cubes = 12 faces), while the DXIL handle declaresTextureCube.resinfoqueries rather than silently returning6.emit/lower.rsis520,845 B(within the 512 KiB limit).Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T04:40:29Z.
Review: APPROVED
LGTM — cube resinfo channel 2 = 6 matches GCN3 §12.16/RADV behavior; gated to kind==5 only so other dims keep the previous result; the hardware test checks both mips.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T06:17:22Z.
Automated triage for the maintainers.
For
image_get_resinfoon a cube (DXIL kind 5),Lower::image_opinemit/lower.rsnow returns the constant 6 in channel 2 instead of 1. Previously channel 2 counted as "not present" for cubes in the2 | 5 | 6arm. 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 inlower/cube_resinfo_tests.rschecks[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:
checkpassing.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-28T04:35:38Z.
Hardware run, since the PR has WARP only: RTX 3070 8 GB, driver 616.56, Windows 11, head
df36af5.cube_resinfo_tests2 of 2 passed, 3 runs, on the hardware adapter and on WARP in the same process (the test asserts both). So the NVIDIA host returns[8, 8, 6, 3]for mip 0 and[4, 4, 6, 3]for mip 1.The 6 is the translator's constant, so the card confirms the width, height and level count around it rather than the face count itself. The face-count rule rests on the ISA text and the gfx1031 measurement cited above.
AI-assisted (Claude Code, Claude Opus 5.5 built this head and ran the test on this card).
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.