shader: count a 32-bit SALU write in a mesh SAVEEXEC arm as one SGPR (Part of #3703) #3785
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3785"
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-12-01T22:02:15Z.
Part of #3703. Fixes the 13 programs that stop at
unproven mesh mask operandon the current stack.Problem
validate_saveexecrecords every scalar destination written in a SAVEEXEC then arm as a register pair. That covers lane masks, but a 32-bit SALU write also marked its neighbour. Those writes become the arm'sscalar_clobbers, which are cleared at the join.In all 13 programs, a lane mask lives in
s[8:9](s_cselect_b64 s[8:9], exec, 0) across a nested SAVEEXEC whose then arm runss_lshl_b32 s7, .... The join cleareds8, and the laters_and_b64 s[2:3], vcc, s[8:9]was refused as an unproven mask.The same over-count made an else arm that reads such a neighbour refuse as
else arm reads a scalar the then arm writes.Change (
gfx1013_direct_mesh.inl)In the then-arm scan, a SOP1/SOP2/SOPK result marks
dst+1only when the opcode name has64(the_b64/_u64/_i64forms, plus*_b64sources such ass_bcnt1_i32_b64, kept as before). VOP results with an SGPR destination (compare masks,v_readfirstlane) and scalar loads are unchanged.Tests (
tests/native_direct_mesh_check.py)saveexec-then-b32-neighbour: the then arm writess29withs_mov_b32, and the else arm readss30. It lowers tophi [ 7, then ], [ 3, else ].saveexec-then-b64-pair:s_mov_b64 s[30:31]in the then arm still keeps the else arm's read ofs31refused.Validation (Windows 11, MSVC, Windows SDK 10.0.26100)
ctest --test-dir out/build/dev -R "native_direct_mesh|mesh": 210/210 (the twomesh_two_exitshardware tests skip as usual).main+ #3708 + #3709 + #3710 + #3729 + #3760 + #3765 + #3770 + #3782 + this: 988 of 1,569 translate, up from 975. 13 gained, none lost. Onmainalone these programs stop at earlier walls. Counts only; request bytes stay local.Independent of #3782; the two touch different lines.
AI-assisted.
🤖 Generated with Claude Code