Shaders: wave32 EXEC moves through _b64 scalar ops keep the mask #3924
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3924"
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 kotekompotek on 2026-12-01T03:24:02Z.
Summary
Wave32 pixel prologues save, widen to whole quads and restore EXEC with 64-bit scalar moves (
s_mov_b64,s_wqm_b64) even though only EXEC's low dword holds lanes.Lanes::soponly recognized the lane-width suffix (_b32in wave32), so the moved mask classified asAtom::Opaque— every guarded vector instruction then depended on an opaque mask and the pixel shaders that use this prologue failed to translate (an opaque lane mask is not supported).The low dword of a 64-bit bitwise operation is the same operation on the low dwords, so in wave32 those are lane-mask operations too; their high dword has no lanes.
sopnow also tries_b64whenwave64is false.Found on the GTA VI boot path: six pixel shaders (including the glyph and loading-art shaders) hit exactly this pattern at their prologue and dropped every draw that used them.
Test plan
cargo test -p victory-shader structure— 14 passed including the newwave32_b64_exec_copies_carry_the_maskfixture (s_mov_b64/s_wqm_b64EXEC save+restore keeps the vector move's guard).AI-assisted change.
Imported from Marvisak/VIctory. Originally posted by passerbyyhx on 2026-12-01T12:30:27Z.
Compared
37db5538with parent63bcca43using a synthetic Wave32 pixel shader on an RTX 4090 Laptop GPU and WARP. A full-screen triangle covered a 4×2 RGBA32F target. The shader selectedx < 2, saved EXEC, widened to whole quads and restored EXEC.On the PR, both the b32 control and the b64 sequence produced the expected eight pixels on both adapters. In each row, every channel was 1 for the first two pixels and 0 for the last two. The parent passed the b32 control on both adapters. For b64, translation stopped at offset 32 with
an opaque lane mask, before any draw was submitted.Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-12-01T15:16:18Z.
Verification (independent, AI-assisted: Hy4 flash). Windows, Rust 1.100.0 (Scoop rust-msvc), MSVC, commit-scoped shallow worktree, per-worktree CARGO_TARGET_DIR.
Base
63bcca43c6a00a758510398fa43096ce7e4f7df0, head37db5538.git diff --numstat→ crates/victory-shader/src/structure.rs 54/2 (single file).One test is added and its name is new on the base —
git grep -F wave32_b64_exec_copies_carry_the_mask 63bcca43 -- .returns no match:structure::tests::wave32_b64_exec_copies_carry_the_mask. (Thedata_loaded_where_a_mask_was_is_no_maskcase visible in the same hunk is context, not added.)git diff --check "63bcca43..37db5538"→ no output, exit 0.Result:
running 1 test,test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 305 filtered out.The test builds a synthetic wave32 block with EXEC set and checks the mask survives the
_b64scalar moves; no title shader bytes, no device, GPU/driver N/A. No game data.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.