shader: lower v_cvt_i32_f32 and v_mad_f32 in the mesh frontend #3704
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3704"
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 R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-12-01T05:42:38Z.
Change
The mesh VALU list now routes
v_cvt_i32_f32andv_mad_f32to the shared ALU, which already lowers both:v_cvt_i32_f32is a saturating conversion with NaN mapped to zero.v_mad_f32is an unfused multiply and add, emitted asfmulthenfadd, notfma. Likev_mad_legacy_f32, it takes three sources.The VOP3 clamp form of
v_cvt_i32_f32keeps the sharedinteger conversion output modifierrefusal.This is item 2 of the work split in #3703 (comment 7301683823). On the 24 captured slot 86 requests listed there, with #3702 also applied:
v_mad_f32now stop at anidxen offenraw load (item 3);v_cvt_i32_f32once past the loop. Their next refusal is the 2D table image load (item 4).Refs #3703, #3641.
Verification
Build
releaseat this branch (Windows 10 19045, MSVC 2022, DXC 1.9.2609):The same 24
_hardwaretests fail on this host without this change (Windows 10 without the Agility SDK; NVIDIA RTX 3080 Ti, driver 32.0.16.1047, debug layer on).New cases in
native_direct_mesh_check.py, built on the source-built triangle:v-cvt-i32-f32:v_cvt_f32_u32 v1, v0, thenv_cvt_i32_f32 v1, v1. Checks thefptosi, the NaN test and that the result reaches the exported X.v-cvt-i32-f32-clamp: the VOP3 form with clamp is refused.v-mad-f32:v_mad_f32 v1, v1, 2.0, -1.0. Checks onefmuland onefadd, and nodx.op.tertiary.f32.Controls:
v-cvt-i32-f32fails withunsupported mesh instruction or EXEC state: v_cvt_i32_f32.v_mad_f32removed from the list,v-mad-f32fails with... v_mad_f32.Evidence and follow-up
Source-built words only. The counts on captured requests are local, offline (
compile_dxil ... gfx1013-container-ms-texture-heap). Note added at the end ofdocs/experiments/native-fixed-mesh57.md.Items 1, 3 and 4 of #3703 stay open.
Checklist
AI-assisted.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-01T08:43:26Z.
Review: APPROVED
Reviewed the reuse of the existing C++ ALU for v_cvt_i32_f32 and v_mad_f32, including source tracking for the three-operand case. The integrated native_direct_mesh and WARP and RTX 4060 startup_mesh57_runtime fixtures passed.