shader: lower v_permlane16_b32 and v_permlanex16_b32 #30
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/30"
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 LakshanSivakumar/Native-Victory-macOS. Originally posted by claytonblythe on 2026-11-26T10:13:37Z.
Summary
During Story Mode world loading (frame 2788 in
--console series-s), two compute shaders were refused withGFX10 code: v_permlane16_b32 is not supported.This change adds support for
v_permlane16_b32(and general VALU lowering forv_permlanex16_b32outside whole-wave sections):crates/victory-shader/src/emit/wave.rs: handlesv_permlane16_b32alongsidev_permlanex16_b32in whole-wave reduction simulation (same 16-lane row vs cross-row in the same 32-lane half).crates/victory-shader/src/emit/lower.rs:v_permlane*as requiringconsole_lanes.v_permlane16_b32andv_permlanex16_b32invalu_opusingread_in_half(dx.op.waveReadLaneAt), since both stay within the lane's 32-lane half and require no cross-half LDS exchange on wave32 hosts (Apple Silicon Metal).fi:0inactive-lane fallback (bound_ctrl:1→0,bound_ctrl:0→ destination's old value) viawaveActiveBallotwhen guarded.crates/victory-shader/src/emit/wave32_tests.rs: addspermlane16_and_permlanex16_lower_within_host32_halfverifying wave32 lowering with 0 exchange barriers.Verification
cargo test -p victory-shader --lib— 216 passed, 0 failed.cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings— 0 warnings.cargo xtask policy— 363 files ok.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T10:17:35Z.
Review: APPROVED
Reviewed and tested on top of current main together with #29: all tests including the new wave32 permlane test, clippy (Windows target) and policy pass. The row/nibble selection matches the ISA (lanes 8-15 take src2's nibbles), and FI/bound_ctrl map to op_sel[0]/[1] as expected. Follow-up when convenient: a value-level test (e.g. a WARP compute run on Windows CI) for the inactive-lane fallback would be nice, since the current test only checks the lowering.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by claytonblythe on 2026-11-26T10:19:19Z.
Live-tested on a 16 GB Apple M4 (
--console series-s,--headless,VICTORY_GUESS_GRAPHICS=1) on top oforigin/main(a2940ab) + PRs #25/#28:v_permlane16_b32compute shaders at frame 2788 now translate and compile on Metal).recorded=16593 encoded=16593 no_pipeline=0 no_texture=0).