Shaders: support cross-half ds_bpermute_b32 and fix group <= 32 OOB lanes on 32-lane GPUs #615
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!615
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@orazal12 on GitHub · 2026-11-25 03:19 UTC · original
orazal12:fix/wave32-bpermute→main· +295 −6 · 2 files · 1 commits · openFixes 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 warnings@HAL9000RELOADED on GitHub · 2026-11-25 19:29 UTC · original
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 (#129).View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.