shader: lower v_and_or_b32 and v_cvt_f16_f32 in the mesh frontend #3743
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3743"
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 lambirou on 2026-12-01T14:03:04Z.
After the scalar bit operations, the forced slot 86 mesh path still refused
v_cvt_f16_f32in 357 requests andv_and_or_b32in 331, ahead of thecontrol-flow, heap-provenance and pixel blocks.
v_and_or_b32(VOP3 0x371) joins the mesh vector list that already handlesv_or3_b32andv_add3_u32, so it takes the three-sourcealu_rulesentry and lowers to(S0 & S1) | S2. The shared operand gatestill refuses abs, neg, clamp and omod.
v_cvt_f16_f32(VOP1 0x0A) joinsthe same list and reuses the compute frontend's integer round-to-nearest-even
narrowing: the sign comes from bit 31, binary32 subnormals become signed
zeros, binary16 subnormals are kept, overflow including the 65520 tie gives
0x7c00, and a NaN keeps its quiet bit. The encoding goes into the low halfand the reaching destination value keeps the high half, so an unproven
destination still refuses and the merged word is not declared uniform.
Validation (Windows, Release; AMD Radeon RX 9060 XT for the hardware run):
cmake --build --preset release --target compile_dxil— 7/7 steps.python -B tests/native_direct_mesh_check.py out\\build\\release\\compile_dxil.exe "<DXC dir>"— pass, including the
v_and_or_b32andv_cvt_f16_f32programs and theunbound/unproven-source controls.
ctest --preset release --no-tests=error -R '^native_direct'— 2/2 pass.Refs #3703
Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-12-01T20:13:12Z.
Review: APPROVED
Reviewed
baa40780by reading the diff; not built or run.Verdict: approve. Both ops join the mesh VALU list and lower through the shared ALU, with uniformity handled correctly. No MUST.
v_cvt_f16_f32to this list. It goes through the same shared narrowing (gfx1013_direct_compute.inl:2102), so the behaviour is identical and only the list entry is duplicated. Whichever lands second can drop its entry on rebase.v_and_or_b32here, andv_cvt_f32_f16plus the two CMPX forms in #3666, are not duplicated. For context: onmain+ #3760, six slot 86 programs from our own capture now stop first atv_cvt_f16_f32, so either PR clears that wall for them.e1161e43, and onlytests/native_direct_mesh_check.pyconflicts withmain158ef794, where both sides appended cases. The source hunk merges cleanly.v_and_or_b32has analu_rulesentry of arity 3, so a result is uniform only when all three sources are.v_cvt_f16_f32has no rule and is not in the hard-coded arity lists, sosourcesis 0 and the merged word is never declared uniform. That matches the new comment, since the high half comes from the destination.Tests:
v-and-or-b32traces(S0 & S1) | S2to the export, and-unprovenrefuses an unbound source.v_cvt_f16_f32cases match the NaN/infinity select chain of the narrowing and export the low half.-unproven-sourceand-unproven-destinationpin both refusals. The second covers the kept high half.CI ran
native_direct_mesh(pr preset filter) green at this head, on the old base.Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-12-01T23:02:53Z.
Rebased onto
origin/main158ef794after #3762, resolving thenative_direct_mesh_check.pyhelper conflict by keeping bothassert_export_columnand the_sop2/_sopc/_sop1_literalhelpers.Head
816ab821. Validation:cmake --build --preset release --target compile_dxil— 17/17.python -B tests/native_direct_mesh_check.py ...— pass.ctest --preset release --no-tests=error -R '^native_direct'— 2/2 passed.AI-assisted.