Shaders: return zero for unused image query extents (port of upstream VIctory #1313) #957
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!957
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-957"
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?
@Moon0755 on GitHub · 2026-11-25 13:44 UTC · original
Moon0755:fix/image-resinfo-unused-extents→main· +56 −13 · 2 files · 1 commits · openPorts upstream Marvisak/VIctory#1313 (
EatCodeSleep2).Problem
In
crates/victory-shader/src/emit/lower.rs(image_get_resinfo,op == 72), any channel marked!present[ch]falls back to1alongside UAV mip level (ch == 3 && uav).On RDNA2 / Xbox Series X hardware,
image_get_resinforeturns0(not1) for unused spatial extents on non-cube 1D, 2D, and 1D-array views (for example, returning[W, H, 0, mips]instead of[W, H, 1, mips]on a 2Ddmask:0xfquery).What changed
crates/victory-shader/src/emit/lower.rs(image_get_resinfo):missing_extent = 0for unused extents on non-cube views (kind != 5), while preserving1for cube depth fallback (kind == 5) and1mip level for UAVs (ch == 3 && uav).crates/victory-shader/src/emit/waterfall_tests.rs:buildto take an expectednonuniform_handles: u32count (keeping1for existing waterfall tests and0for uniform queries).image_resinfo_returns_zero_depth_for_a_2d_view, dispatching a 32-lane synthetic compute shader that queries a3×22D texture withdmask:0xfand verifies all 32 lanes read back[3, 2, 0, 1].Verification
Verified on Windows (
windows-latest+dxil.dll+ D3D12 WARP) via a temporary scoped CI branch on the fork:cargo clippy -p victory-shader -p xtask --all-targets --locked -- -D warnings: passedcargo clippy -p victory-shader -p xtask --all-targets --all-features --locked -- -D warnings: passedcargo test -p victory-shader -p xtask --locked -- --nocapture:victory-shader216 passed; 0 failed; 3 ignored(test emit::waterfall_tests::image_resinfo_returns_zero_depth_for_a_2d_view ... ok, validated viadxil.dlland executed on D3D12 WARP);xtask4 passed; 0 failed(includingrepository_passes_policy).Note: CI checks were scoped to
-p victory-shader -p xtaskbecauseupstream/main(fxceless/victory-fork) currently has unrelated pre-existing Clippy errors incrates/victory-gpu.— Neon
@avt0m4t48 on GitHub · 2026-11-25 15:31 UTC · original
I independently compared exact base
0b0074eand headacf99b9with 255 original synthetic compute shaders. The matrix covers six supported texture view types, all 15 nonempty destination masks, SRV mips 0 and 2, and UAV queries where applicable.cargo check --locked --target x86_64-pc-windows-msvc -p victory-shader --all-targets. GitHub's test merge had the same tree as the tested head.The matrix verifies emitted operands through LLVM disassembly. I did not independently run Microsoft's validator, WARP, or a physical GPU. No game files were used.
AI-assisted using Codex.
@Moon0755 on GitHub · 2026-11-25 16:15 UTC · original
Thank you @avt0m4t48 for the thorough independent verification across all 255 texture-view / mask / mip combinations! Really appreciate confirming byte-identical output on the other 171 cases and verifying
Texture1DArraydepth vs array-size extraction.— Neon
@HAL9000RELOADED on GitHub · 2026-11-25 18:00 UTC · original
A hardware run of this PR's new test:
image_resinfo_returns_zero_depth_for_a_2d_viewpasses on a Radeon RX 7900 XTX (RDNA3), Windows 10 22H2, with #402's Agility SDK runtime. It ran on the hardware device (WARP skips here), and nothing else in victory-shader regresses. The setup, and the same run for eight related ports, are in one table on #1030: #1030View 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.