Shaders: return 0 for unused depth and height channels in image_get_resinfo #1936
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1938"
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 ashrafsdrop on 2026-11-25T01:19:45Z.
Resolves VIC-BT-038 from #1249:
Summary
Unused Dimension Return Values:
In \crates/victory-shader/src/emit/lower.rs, \image_get_resinfo\ lowering previously returned \one\ (1) for channels missing from the resource dimension (!present[ch]):
Tests:
Added unit test
esinfo_returns_zero_for_unused_depth_channel_on_2d_texture\ in \lower.rs\ asserting successful lowering of \image_get_resinfo\ with all four channels (\dmask: 0xF) on a 2D texture.
Verification
Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-25T01:25:53Z.
Overlap note, from reading the diffs (not run): #1313 (EatCodeSleep2, opened a day earlier for the same finding, VIC-BT-038 in #1249) makes the same change to
image_get_resinfo: a channel DXIL leaves out reads 0 rather than 1, and a UAV still reports one level. One difference: #1313 keeps 1 for a missing extent of a cube view (kind == 5), while this PR returns 0 there too. #1313 now conflicts withmain. Settling on one, and on the cube case, would avoid two versions.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by Headache3318 on 2026-11-25T02:03:50Z.
Tested on Linux (Arch, kernel 7.3.5, 3× RTX 4090 driver 620.73.04), Rust 1.98.1 (pinned). PR head
bac64f0applied cleanly onto currentmainccfb029.cargo test -p victory-shader --locked: 145 passed, 0 failed, 2 ignored. All tests pass, including the newresinfo_returns_zero_for_unused_depth_channel_on_2d_texturetest.cargo clippy -p victory-shader --all-targets --all-features -- -D warnings: 4 pre-existing errors in test code (fail identically on mainccfb029). The PR introduces no new clippy warnings.Not tested: Windows MSVC build, the title itself. AI-assisted.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T03:05:20Z.
Review: APPROVED
Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main
940d32f69b,cargo test -p victory-shader --locked.145 passed / 0 failed / 2 ignored. image_get_resinfo returns 0 for unused depth/height channels (+1 test) — resinfo completeness for typeless/partial views.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T08:16:05Z.
Automated triage for the maintainers.
Needs work.
The change in
crates/victory-shader/src/emit/lower.rs(image_get_resinfolowering, theop == 72branch) makes channels the view does not have (height of a 1D view, depth of 1D/2D/cube views) read 0 instead of 1. This changes emulation behaviour, and the PR gives no evidence for it beyond "per RDNA2 ISA specifications". Please cite the source: the section of the public RDNA2 ISA document, a console compiler output, or the title's own code that depends on it. Whether the hardware returns 0 or 1 for a missing extent is the whole point of the change.resinfo_returns_zero_for_unused_depth_channel_on_2d_textureonly checks that lowering succeeds (!lowered.dxil.is_empty()). That was already true onmain. It should check that the depth channel is the constant 0.CI:
checkpasses.What would change the verdict: a cited reference for the 0 value, including the cube case, and a test that asserts the value.
Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by ashrafsdrop on 2026-11-25T10:54:44Z.
Closing in favor of #1313 which opened earlier for VIC-BT-038 with end-to-end readback testing in waterfall_tests.rs.
upstream-sync referenced this pull request2026-11-25 13:02:57 +00:00
Pull request closed