Shaders: return zero for unused image query extents #1313
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1313"
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 EatCodeSleep2 on 2026-11-24T17:21:03Z.
Summary
Return zero for unused extents in the 1D, 2D and 1D-array
image_get_resinfocases. UAVs continue to report one mip level. Cube queries retain their existing behavior.Refs #1249, finding VIC-BT-038. The reported RDNA2 behavior is also documented in the published hardware measurements.
Verification
[3, 2, 1, 1]on main. After the fix it validates and returns[3, 2, 0, 1]on native Direct3D 12 and WARP.GPU readback covered 2D. This run used no RDNA2 hardware or game files. AI-assisted.
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T17:26:48Z.
Review: APPROVED
Tested merged cleanly onto
main(ffe310e) on Windows 11 x64 (Rust 1.98.1 MSVC):cargo test -p victory-shader emit::lower: 11 passed, 0 failedcargo clippy -p victory-shader --all-targets: 0 warningscargo xtask policy: okClean fix returning zero for unused image query extents. Approving.
AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by crosettiremi on 2026-11-24T17:28:04Z.
Independent XCL cross-check on a Windows RX 7900 XT, using XCL's native D3D12 compute fixture. A 4×4, single-mip 2D texture queried with all four result channels returned
[4, 4, 1, 1]before changing the emitter. Changing the unused extent to zero returned[4, 4, 0, 1]across the tested lanes. XCL’s existing native cube-array fixture also passed with 12 layers for two cubes. This reproduces the 2D discrepancy in a second translator. The game impact and 1D cases are unmeasured here.Game follow-up on the same RX 7900 XT: the XCL test build accepted the account selection and continued world streaming. The last captured frame was dark, and the process ended with a second-chance guest breakpoint at RVA 0xf2cc4b after 204 s with no logged device removal. The 2D query correction alone did not produce a visible world on this run.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T20:09:45Z.
Review: APPROVED
Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (
ffe310e), cargo test -p victory-shader --locked → 96 passed, 0 failed. Execution/valu tests are #[cfg(all(test, windows))] and only run on Windows; macOS covers lowering/structure/IR unit tests.image_resinfo returns zero depth for 2D views when the extent is unused — avoids a bogus depth value reaching shaders. Small, tested.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:21:59Z.
Automated triage for the maintainers.
Needs rebase. This pull request conflicts with
main(conflicting:crates/victory-shader/src/emit/waterfall_tests.rs). It will be reviewed once it is rebased onto the currentmain.Generated by Claude Code
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.