Skip to content

victory-shader: lower direct barycentrics, 32-lane wave64 whole-wave ops, v_permlane*16_b32, and f64 arithmetic - #17

Merged
wbkepler merged 1 commit into
mainfrom
shader/translator-batch
Nov 25, 2026
Merged

wbkepler merged 1 commit into
mainfrom
shader/translator-batch

Conversation

@wbkepler

Copy link
Copy Markdown
Owner

Summary

  • Direct SV_Barycentrics reads: Lazily declare and load SV_Barycentrics (SemanticKind::Barycentrics = 28, DxilProgramSigSemantic::Barycentrics = 23, flags::BARYCENTRICS / SFI0 0x20000) when a pixel shader reads (I, J) barycentrics outside v_interp_*, without changing plain interpolated pixel inputs.
  • Whole-wave reductions/scans for <= 32 host threads and multi-wave groups: Allow wave64 whole-wave reductions/scans when host_threads <= 32 (direct single-wave DXIL wave ops without shared-memory lane exchange) as well as multi-wave groups.
  • 16-lane cross-half permute: Lower v_permlanex16_b32 and v_permlane16_b32 via per-half nibble extraction over {src2, src1} and waveReadLaneAt.
  • 64-bit float bitcode & ALU lowering: Add DXIL double bitcode support (TypeDef::Double, Const::Double, Cast::FpTrunc/FpExt, flags::DOUBLES + flags::DOUBLE_EXTENSIONS and SFI0 mapping) and lower v_cvt_f32_f64, v_cvt_f64_f32, v_cvt_f64_i32, v_cvt_f64_u32, v_add_f64, v_mul_f64, and v_fma_f64 in emit/lower/f64.rs.

Verification

  • cargo clippy -p victory-shader -p victory-gpu --all-targets -- -D warnings — passed
  • cargo clippy -p victory --features diagnostics --all-targets -- -D warnings — passed
  • cargo xtask policy — passed (188 files ok)
  • cargo test -p victory-shader — 302 passed; 0 failed; 3 ignored (includes direct_barycentrics_read_translates_and_validates, small_wave64_group_runs_whole_wave_min_reduction_on_gpu, and permlanex16_and_f64_arithmetic_match_reference)
  • cargo test -p victory-gpu -- --test-threads=1 — 188 passed; 0 failed; 5 ignored
  • Full shader cache prebuild + 240 s live world run: 0 device removals / panics, refused containers reduced (109 -> 103), all 4 targeted shader refusal classes eliminated, steady-state 325.1–377.1 ms/frame.

…ops, v_permlane*16_b32, and f64 arithmetic

- Add lazy `SV_Barycentrics` (`SemanticKind::Barycentrics = 28`, `DxilProgramSigSemantic::Barycentrics = 23`, `flags::BARYCENTRICS` / `SFI0 0x20000`) when a pixel shader reads `(I, J)` barycentrics directly outside `v_interp_*`.
- Allow whole-wave reductions/scans in `wave64` compute shaders when host thread count is at most 32 (single 32-lane wave without lane exchange) or in multi-wave groups.
- Lower `v_permlanex16_b32` and `v_permlane16_b32` using per-half nibble lookup from `{src2, src1}` and `waveReadLaneAt`.
- Add DXIL `double` bitcode support (`TypeDef::Double`, `Const::Double`, `Cast::FpTrunc`/`FpExt`, `flags::DOUBLES` and `flags::DOUBLE_EXTENSIONS`) and lower `v_cvt_f32_f64`, `v_cvt_f64_f32`, `v_cvt_f64_i32`, `v_cvt_f64_u32`, `v_add_f64`, `v_mul_f64`, and `v_fma_f64` in `emit/lower/f64.rs`.
- Add unit and host GPU/DXIL tests covering each lowering.
@wbkepler
wbkepler merged commit 302724f into main Nov 25, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant