Shaders: support cross-half ds_bpermute_b32 and fix group <= 32 OOB lanes on 32-lane GPUs #615
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/615"
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 orazal12 on 2026-11-25T03:19:28Z.
Fixes and extends
ds_bpermute_b32lowering for console wave64 shaders running on 32-lane GPUs (NVIDIA / wave32):group <= 32OOB lane reads: previously passedsrcin0..=63directly todx.op.waveReadLaneAt.i32on a 32-lane host wave (UB / wraps mod 32 instead of returning0for lanes32..63). Now maskslane = src & 31and selects0whensrc >= 32.ds_bpermute_b32(group > 32): allocates 64-dword-per-console-wave LDS scratch (checking D3D12's 32 KiB limit with 1 dword reserved forwave_base), exchanges all 64 lanes viastore -> group_sync -> load -> group_sync, selects0for missing lanes in partial tail waves (!group.is_multiple_of(64)), and hooks intoneeds_every_lane/widenwhen called inside a per-lane branch.v_readlane_b32(maskssrc & 31underlocal && local_any; refuses cleanly underlocal && !local_any).Verification:
cargo test -p victory-shader --offline: 218 passed, 0 failed (4 newwave64_testsvalidated withdxil.dlland executed on hardware GPU covering[32,1,1],[64,1,1],[128,1,1],[96,1,1], per-lane branch widening, and 32 KiB LDS overflow refusal)cargo test -p xtask --offline: 4 passed (asset policy check ok)cargo clippy -p victory-shader --all-targets --offline -- -D warnings: 0 warningsupstream-sync referenced this pull request2026-11-25 08:08:49 +00:00
Imported from fxceless/victory-fork. Originally posted by HAL9000RELOADED on 2026-11-25T19:29:39Z.
RX 7900 XTX (RDNA3), Windows 10 + #402 for SM 6.6, main
d510ee4: all 4 new tests pass on the card with this PR, and all 4 fail with the tests 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.