Repository navigation
victory-shader: lower direct barycentrics, 32-lane wave64 whole-wave ops, v_permlane*16_b32, and f64 arithmetic - #17
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SV_Barycentricsreads: Lazily declare and loadSV_Barycentrics(SemanticKind::Barycentrics = 28,DxilProgramSigSemantic::Barycentrics = 23,flags::BARYCENTRICS/SFI0 0x20000) when a pixel shader reads(I, J)barycentrics outsidev_interp_*, without changing plain interpolated pixel inputs.<= 32host threads and multi-wave groups: Allowwave64whole-wave reductions/scans whenhost_threads <= 32(direct single-wave DXIL wave ops without shared-memory lane exchange) as well as multi-wave groups.v_permlanex16_b32andv_permlane16_b32via per-half nibble extraction over{src2, src1}andwaveReadLaneAt.doublebitcode support (TypeDef::Double,Const::Double,Cast::FpTrunc/FpExt,flags::DOUBLES+flags::DOUBLE_EXTENSIONSandSFI0mapping) and lowerv_cvt_f32_f64,v_cvt_f64_f32,v_cvt_f64_i32,v_cvt_f64_u32,v_add_f64,v_mul_f64, andv_fma_f64inemit/lower/f64.rs.Verification
cargo clippy -p victory-shader -p victory-gpu --all-targets -- -D warnings— passedcargo clippy -p victory --features diagnostics --all-targets -- -D warnings— passedcargo xtask policy— passed (188 files ok)cargo test -p victory-shader—302 passed; 0 failed; 3 ignored(includesdirect_barycentrics_read_translates_and_validates,small_wave64_group_runs_whole_wave_min_reduction_on_gpu, andpermlanex16_and_f64_arithmetic_match_reference)cargo test -p victory-gpu -- --test-threads=1—188 passed; 0 failed; 5 ignored0device removals / panics, refused containers reduced (109->103), all 4 targeted shader refusal classes eliminated, steady-state325.1–377.1 ms/frame.