Shaders: return zero for unused image_get_resinfo extents #2457
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2457
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@makmatvey on GitHub · 2026-11-25 13:52 UTC · original
makmatvey:cursor/shader-resinfo-unused-zero-c78e→main· +58 −6 · 2 files · 1 commits · openWhat'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).
@cloph-dsp on GitHub · 2026-11-25 15:41 UTC · original
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.@Marvisak on GitHub · 2026-11-25 15:55 UTC · original
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
@upipibi on GitHub · 2026-11-25 17:29 UTC · original
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).
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.