Shaders: return 0 for unused depth and height channels in image_get_resinfo #1938
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!1938
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1938/head"
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?
@ashrafsdrop on GitHub · 2026-11-25 01:19 UTC · original
ashrafsdrop:shader/resinfo-unused-channels→main· +29 −4 · 1 files · 1 commits · closed without mergingResolves 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
@upipibi on GitHub · 2026-11-25 01:25 UTC · original
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).
@Headache3318 on GitHub · 2026-11-25 02:03 UTC · original
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.
@Marvisak on GitHub · 2026-11-25 08:16 UTC · original
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
@ashrafsdrop on GitHub · 2026-11-25 10:54 UTC · original
Closing in favor of #1313 which opened earlier for VIC-BT-038 with end-to-end readback testing in waterfall_tests.rs.
Pull request closed