Shaders: return zero for unused image_get_resinfo extents #2455
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2457"
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 makmatvey on 2026-11-25T13:52:04Z.
What's wrong
image_get_resinfofilled unused extents with1(DXIL's unused-channel fill) for 1D, 2D and 1D-array views. On RDNA2 those channels are0. Cubes still use1for the unused depth channel; UAVs still report one mip level.Tracked as VIC-BT-038 in #1242 / #1249. Open #1313 covers the same fix but is
triage: needs rebase/ dirty against currentmain; this is a focused re-land.What the change does
crates/victory-shader/src/emit/lower.rs: unused extents get0except cubes (kind == 5), which keep1. UAV mip count stays1.crates/victory-shader/src/emit/waterfall_tests.rs: synthetic 2Dimage_get_resinfo(dmask 0xf) expects[3, 2, 0, 1]on hardware and WARP.Tests
image_resinfo_returns_zero_depth_for_a_2d_view(Windows GPU / WARP +dxil.dllwhen present).cargo xtask policy: 182 files ok.cargo test --workspace --locked/ clippy left to Windows CI.No game data used.
Refs #1249, #1242 (VIC-BT-038).
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T13:54:25Z.
Review: APPROVED
Verified against
origin/main(940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:image_get_resinfoextents passes all waterfall tests including the new 2D depth-zero readback test.cargo test -p victory-shader waterfall_tests: 6/6 passed on RTX 5090, 6/6 passed on WARP (includingimage_resinfo_returns_zero_depth_for_a_2d_view).cargo clippy -p victory-shader --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 183 files ok.AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T14:11:07Z.
Review: APPROVED
Tested locally: merged into main
940d32f69b,cargo test -p victory-shader --lockedon macOS arm64 — 144 passed, 0 failed, 2 ignored (Windows-gated hardware execution tests not run here). Approving — zero returned for unused image_get_resinfo extents.Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-25T15:41:43Z.
Independent local validation for PR #2457 (Windows, Rust 1.100.0/MSVC, head
a2649d8, no game data):cargo test --locked -p victory-shader --lib-> 248 tests passed, 0 failed, 3 ignored, exit 0;git diff --checkclean. CPU-only regression run; synthetic unused image_get_resinfo scenario not replayed. AI-assisted (Hy4 flash). GPU/driver N/A for CPU tests.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T15:55:56Z.
Automated triage for the maintainers.
This changes what
image_get_resinforeturns for unused extents (crates/victory-shader/src/emit/lower.rs, theop == 72branch): 0 instead of 1, except for cubes. CI passes, but it changes emulated shader behaviour on the strength of "(RDNA2)" alone, and the new test checks the values the new code produces rather than a reference. To move forward, please cite the evidence: the section of the public RDNA2 ISA document that defines the resinfo result per image type, or console compiler output that relies on it. Please also explain why cubes keep 1 for the unused channel while 1D/2D views get 0, since the same source should settle both. #1313 covers the same fix; the maintainers should pick one.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-25T17:29:45Z.
Evidence for the triage ask at
a2649d8. Public sources only, no game data.The RDNA 2 ISA does not define it. "RDNA 2" ISA Reference Guide (30 Nov 2020), §12.16 MIMG Instructions, IMAGE_GET_RESINFO (p. 217 of 283), says only: "Returns 4 integer values into VGPRs 3-0: {num_mip_levels, depth, height, width}." §8.2.3 Table 42 gives only the address (mipid). Nothing per image type, nothing on unused channels.
Cubes: the sources that cover them say 6 per cube, not 1.
1D/2D: no AMD text, but public PC RDNA 2 measurements give 0:
(1024, 0, 0, 1)(1024, 64, 0, 1)(1024, slices, 0, 1)(8, 8, 6, 1).So the 0 for 1D, 2D and 1D-array matches PC RDNA 2 hardware, but the RDNA 2 document doesn't say it. The cube's 1 (main's value, kept here) matches no source: hardware and AMD's later documents give 6 per cube. The cube-array ×6 is in #1256.
AI-assisted (Claude Code, Claude Opus 5.5).
Pull request closed