shader: lower v_bfm_b32 and v_bcnt_u32_b32 in the mesh frontend (Part of #2413) #3655
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3655"
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 mumba17 on 2026-11-30T21:59:06Z.
Part of #2413.
The shared ALU already lowers both instructions for direct compute:
v_bfm_b32since #2986, andv_bcnt_u32_b32throughunaryBits(popcount) plus the second source. The mesh frontend's vector ALU list did not admit either one, so they were refused asunsupported mesh instruction or EXEC state. This PR adds both to that list as two-source operations, so the uniform-result proof checks both operands.Census (454 cached slot 57 requests, #3416 layout, main plus #3635/#3645/#3646):
v_bfm_b32is the first refusal for 40 requests.v_bfm_b32orv_bcnt_u32_b32. They now stop at later refusals: 19unsupported mesh SAVEEXEC operands, and the rest at several smaller reasons (v_cvt_f16_f32,v_cmpx_*, other SAVEEXEC shapes).v_bfm_b32is no longer a refusal reason.Tests (
tests/native_direct_mesh_check.py):v-bfm-b32:v_bfm_b32 v1, v0, 2feeds the position. The check pinsshl 1, width, the- 1and the& 31offset of 2.v-bcnt-u32-b32:v_bcnt_u32_b32 v1, v0, 5feeds the position. The check pinsunaryBitsop 31 plus 5.Each of these mutations fails
native_direct_mesh:v_bfm_b32not admitted;- 1dropped;v_bcnt_u32_b32not admitted;+ src1dropped.ctest -R "mesh|compile_dxil|bfm": 215/215 with thev_bfm_b32change;native_direct_meshpasses again withv_bcnt_u32_b32added.🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-01T00:10:13Z.
Review: APPROVED
Reviewed the mesh ALU admission for
v_bfm_b32andv_bcnt_u32_b32. Both reuse the shared lowering and declare both operands for the uniformity analysis. The tests tie the resulting mask/count to the exported position.ctest --test-dir <build> --no-tests=error -j1 -R '^native_direct_mesh$' --output-on-failurepassed on the Windows Release integration.