Repository navigation
Conversation
… RDNA2 does (port of upstream VIctory fxceless#926)
|
I checked exact base I generated 44 synthetic compute shaders per revision from instruction words, using two runtime root constants and a live UAV store. The VOP3 matrix used
The Linux shader library suite passed on both revisions (171 passed, 2 ignored each), and |
|
Thank you — Neon |
|
A hardware run of this PR's new tests: |
Hand port of upstream PR fxceless#926 (BastienRdz, aaa8b6d + 13b6019; also fxceless PR fxceless#1036). The console's RDNA2 ignores VOP3 op_sel on 16-bit compares (v_cmp*/v_cmpx* on f16, u16, i16) and always compares the low halves, measured on gfx1036 over 146 cases in upstream fxceless#833. We applied op_sel to them and compared the high halves. Non-compare 16-bit ops and SDWA word selects still honour their selects; v_cmp_class is left as it was (not measured). This is the console's behaviour, so it is right on every host vendor. Co-Authored-By: BastienRdz <58186763+BastienRodz@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017V7WBCi8h4eymnRhdth77t
…isons (port of upstream VIctory) head 461cc49
Port of upstream
Marvisak/VIctory#926(originally authored by@BastienRodz).Summary
On RDNA2 (
gfx1036), 16-bitv_cmp_*_f16,v_cmp_*_u16, andv_cmp_*_i16comparisons ignore VOP3op_selbits and always read the low 16 bits of each source operand, whereasv_cmp_class_f16and SDWAWORD_0/WORD_1selects still select the upper half.Previously,
Lower::half_srchonoredv.opselfor all 16-bit instructions, causing 16-bit VOP3 comparisons withop_selset to read the wrong half of the source register.Changes
crates/victory-shader/src/emit/lower.rs: inLower::half_src, ignorev.opselwheninst.name()starts with"v_cmp"and does not contain"class"(preservingv_cmp_class_f16and SDWAWORD_0/WORD_1behavior).crates/victory-shader/src/emit/valu_tests.rs: added D3D12 WARP regression testscmp16_ignores_op_sel_as_rdna2_does(coveringv_cmp_eq_u16,v_cmp_lt_i16,v_cmp_lt_f16,v_cmp_class_f16) andcmp16_sdwa_preserves_word_selects.Verification
Verified on
windows-latestvia GitHub Actions (run 45659115338):cargo clippy -p victory-shader -p xtask --all-targets --locked -- -D warnings— passedcargo clippy -p victory-shader -p xtask --all-targets --all-features --locked -- -D warnings— passedcargo test -p victory-shader -p xtask --locked -- --nocapture—217 passed; 0 failed; 3 ignored(includingcmp16_ignores_op_sel_as_rdna2_doesandcmp16_sdwa_preserves_word_selectsexecuted on D3D12 WARP, plusxtask4 passed,repository_passes_policypassed)— Neon