shader: accept the mesh group exchange without the EXEC save #3444
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3444"
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 Leyukaka on 2026-11-29T09:16:15Z.
Part of #3416
Branch
shader-mesh-exchange-nosave, head08cf44c8, based on main1a0120ba. Two commits:9965a0c9mesh: accept the group exchange without the EXEC save08cf44c8tests: refuse near-miss 60-byte mesh exchange windowsFiles:
src/gfx1013_direct_mesh.inl,tests/native_direct_mesh_check.py.What changes
The native mesh frontend matched the group-id exchange only in its 64-byte form. That form is
s_mov_b64 exec, 1, thens_mov_b64 s[saved], exec, then the AND mask and 13 fixed tail words. The same sequence also appears without the save: 60 bytes, every other word identical. On main1a0120bathat form is refused withmesh group-index exchange shape or entry state is not covered(the refusal #3420 added).Matcher changes in
src/gfx1013_direct_mesh.inl:381-411(line numbers at the branch head):has_savefrom the second word (:383) and reads the mask at +8 or +4 (:384, :388). It checks the same tail after the mask (:389-391) and advances byexchange_size, 64 or 60 bytes (:387, :411).!branch,!exec_skip,full_exec, wave64,group_stride.s_mov_b64 exec, s[x:y]from a pair that was never saved is still refused.Evidence
On this head (base
1a0120ba): configure, buildcompile_dxil, thenResult:
native_direct_meshPassed.Tests:
group-no-saveis accepted and containsdx.op.groupId.i32.group-no-save-restoreis refused withmesh EXEC restore lacks a still-valid reaching mask.group-no-save-near-maskandgroup-no-save-near-taileach flip one bit in the 60-byte window, in the AND mask or in the first tail word. Both expectmesh group-index exchange shape or entry state is not covered. That text has one source,src/gfx1013_direct_mesh.inl:1133, reached when thes_mov_b64 exec, 1opener is not matched.Mutation on this head, reverted afterwards:
bool exchange = has_save && ...(:389)group-no-savefails:native compute +0x0: mesh group-index exchange shape or entry state is not coveredMutations on the previous revision (640d4b60 on main
212d4b5f, same matcher change), not repeated on this head:truegroup-no-save-near-mask: compiledk=1group-no-save-near-tail: compiledNot covered
dx.op.groupId.i32substring does not prove the exchange produced the value that is read. What the test does show: an unmatched opener is refused, so a successful compile means the window was consumed.s_mov_b64 exec, -1right after the window. No case has other instructions between the window and that restore.CI
On main
1a0120batheprtest preset filter inCMakePresets.jsondoes not matchnative_direct_mesh, and theprbuild preset does not listcompile_dxil.Build and test on Windowsdoes not exercise this change.Interactions with our other open mesh branches
This branch touches the same two files as #3439 (
f74eacc8) and the same test file as #3438 (0feac9c2). Bygit merge-tree --write-treeat these heads:shader-mesh-exec-widen(958d341e): cleanshader-mesh-udiv-ops(0f84c3ac): cleanThe combinations were not built.