shader: lower v_cvt_f32_f16 and v_cmpx_eq_i32 in the mesh frontend #3888
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3888
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3886"
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?
@Leyukaka on GitHub · 2026-12-02 19:53 UTC · original
Leyukaka:take/3666→main· +31 −2 · 2 files · 3 commits · openCarries #3668 by @Kawiu with their commits. Part of #2413.
#3668 is approved but conflicts with
main. The author's commit is kept with its authorship and message (9032cea5e); one commit on top reduces it to whatmainstill lacks. @Kawiu, if you would rather rebase #3668 yourself, say so and I will close this PR.Change
Since #3668 was opened,
mainlowersv_cvt_f16_f32and every ordered f32 CMPX compare,v_cmpx_lt_f32included, inlower_mesh. Two of the four forms are still missing, and this PR adds them insrc/gfx1013_direct_mesh.inl:v_cmpx_eq_i32narrows the lane mask likev_cmpx_eq_u32: the new lane-active predicate is the parent mask AND the lane's own compare. EQ is the same bit test signed or unsigned. The existing refusals apply: no DPP, SDWA, abs, neg, omod or clamp.v_cvt_f32_f16joins the lane-ALU list and uses the shared lowering (legacyF16ToF32), so the partial-EXEC write merge applies unchanged.Changed from #3668, in
294efc0c2:v_cmpx_lt_f32goes back tomain's f32 CMPX branch, and the duplicatev_cvt_f16_f32check is dropped.v_cmpx_le_f32is now lowered onmain, so the refusal control usesv_cmpx_ne_i32(VOPC0x95).v_cmpx_lt_f32check now requires the firstfcmp oltoperand to be the value built from the inline 0, so swapped operands fail it.The diff against
mainis 2 files, +31 -2.Validation
Windows, MSVC, dev preset, head
294efc0c2.Result: On the exact head of this branch, with MSVC:
native_direct_meshpasses, including the newv_cmpx_eq_i32andv_cvt_f32_f16cases and thev_cmpx_ne_i32control.tests/native_direct_mesh_check.pyadds, on the existing source-built triangle:v_cvt_f32_f16 v1, v2: the exported X is the bitcast ofdx.op.legacyF16ToF32(131, ...).v_cmpx_eq_u32,v_cmpx_eq_i32andv_cmpx_lt_f32in a save / compare /s_cbranch_execz/ restore sequence: the lane predicate is thebrcondition of the work block, the write isselect i1 <predicate>, i32 2, i32 <old v1>, and the joinphitakes the old value from the empty edge and feeds the exported X.v_cmpx_ne_i32in the same sequence is refused withunsupported mesh instruction or EXEC state: v_cmpx_ne_i32.Known limits
@R0Y00 on GitHub · 2026-12-02 19:58 UTC · original · reviewed
I reviewed
294efc0cand independently ran Windows/MSVC Debugcmake --build --preset dev --target compile_dxilandctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^native_direct_mesh$'(1/1). The two remaining forms use the existing partial-EXEC rules, and the fixture retains the unsupported compare refusal. Please coordinate with @Kawiu on whether to carry this reduced change in #3668 or here so we land it once.@R0Y00 on GitHub · 2026-12-02 20:13 UTC · original · reviewed
The updated head
a67cf533includes #3887, which fixes the old Linux84 != 83error. I ranpython -B tests/standin_exports_check.py(476 checks, six mutations) and Windows/MSVC Debugctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^native_direct_mesh$'(1/1), both passed. The choice of landing PR with @Kawiu is still open.s_bitset1_b32, then stop at a scalar loop #3705s_bitset1_b32, then stop at a scalar loop #3705@R0Y00 on GitHub · 2026-12-03 06:34 UTC · original
Independent MSVC Debug check at
a67cf533: builtcompile_dxilandd3d12_xs.dll, thenctest --preset dev --no-tests=error -j 1 -V -R '^native_direct_mesh$'passed (1/1). I checked the signed compare’s parent-mask intersection and the half-to-float conversion using the existing partial-EXEC write merge. The fixture checks emitted DXIL and the unsupported CMPX refusal; these two opcodes still have no GPU draw here. I’ll keep the two PRs coordinated while Kawiu has the chance to update #3668.@R0Y00 on GitHub · 2026-12-03 08:38 UTC · original · approved these changes
Technical approval for
a67cf533. I independently rebuilt compile_dxil and d3d12_xs.dll with MSVC Debug and ran native_direct_mesh (1/1), including the emitted signed equality path, half-to-float conversion and unsupported signed CMPX refusal. Current main merges cleanly and required CI passed. This fixture checks emitted DXIL. The original submission #3668 and this carried branch still need a single landing choice.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.