Shaders: keep literal select mask bits when lowering local half-waves #277
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/277"
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 fxceless/victory-fork. Originally posted by fluffyflattershy-afk on 2026-11-24T23:09:02Z.
Change
A
v_cndmask_b32using a literal 64-bit scalar mask was refused in local half-wave lowering. When console lanes are already mapped, both host waves can use the literal and select the bit at their console lane index. This select requires no group exchange. Computed mask pairs still use the existing refusal.Verification
emit::wave64_testspassed.cargo clippy --locked --offline -p victory-shader --all-targets -- -D warningsandcargo xtask policypassed.AI-assisted with Codex. The test uses only synthetic inputs.
Imported from fxceless/victory-fork. Originally posted by ErRusso on 2026-11-24T23:35:19Z.
Review: APPROVED
Reviewed at
6c835cdagainst2119b0e.Verification:
victory-shader --libbuilds forx86_64-pc-windows-gnu.local_waves_select_their_console_bits_from_a_constant_maskpasses here (the hardware dispatch is skipped because this Wine host has no SM 6.6 device; DXIL validation and lowering still ran).emit::wave64_testspass under Wine.The change is correct: a local half-wave can select bits from a literal 64-bit mask because both host waves see the same constants and
lane_bitrelabels each wave's lanes throughconsole_lane(). Computed masks still take the refusal path, and the condition requires both halves to be literal, so a partially computed wave64 mask is still rejected.self.exchange.is_some()is redundant withself.local, but harmless.Non-blocking: add a negative test that a computed mask (or a mask with only one literal half) is still refused in a local half-wave. That would lock in the boundary the new condition draws.
LGTM.
Imported from fxceless/victory-fork. Originally posted by HAL9000RELOADED on 2026-11-25T19:29:45Z.
RX 7900 XTX (RDNA3), Windows 10 + #402 for SM 6.6, main
d510ee4: the new testlocal_waves_select_their_console_bits_from_a_constant_maskpasses on the card with this PR, and fails with the test alone on the base. No other test changed. Run table: #129 (https://github.com/fxceless/victory-fork/pull/129#issuecomment-7172358511).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.