shader: expect clamped mesh output counts in native_direct_mesh #3616
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3616"
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-11-30T14:32:45Z.
Change
native_direct_meshfails onmainat itstoo-many-primitivescase. #3537 changed the native mesh frontend to clamp the loaded vertex and primitive counts to the layout maxima, in place of refusing them withmesh count exchange exceeds declared range or lacks an unsigned bound. The case still expected the refusal, so the program compiled and the assertion failed. Thenative_direct_meshtest is not in theprpreset filter, so CI did not show it.The case now checks the new behavior: the count exchange compares the vertex count against the declared 3 and the primitive count against the declared 1, selects the limit when the loaded value is larger, and passes the two selected values to
setMeshOutputCounts. Test only; no source file changes. Refs #3537.Verification
Commit
dbcc0986onmain35a3f6d6, Windows 10 22H2 (build 19045), MSVC 19.52.37029, CMake 4.3.1, Python 3.13.7, DXC 1.9.2609.5, Release build. No GPU or debug layer is involved: the test compiles withcompile_dxiland dumps the DXIL.Before this change, on
main077bff3a, the same command fails:AssertionError ... too-many-primitives, because the program compiled instead of being refused.Evidence and follow-up
Negative control: with the source changes of
617ce7cf(#3537) reverse-applied, the updated case fails withnative compute +0x18: mesh count exchange exceeds declared range or lacks an unsigned bound. The clamp is therefore what the case now observes. Without the clamp the program is refused, so aselecton the declared limits cannot appear. The in-range path is still covered by the existinggroup-countscase.Basis for clamping: the D3D12 Mesh Shader specification requires the counts passed to
SetMeshOutputCountsto be no larger than the lengths of the declared output arrays.#3505 (draft) edits the first 150 lines of the same file; this change is near line 521, so the two do not overlap.
CI does not run this test, and this PR does not change the CI filter. It stays out of scope here.
Checklist
AI-assisted: prepared with Claude Code; the commands and results above were run on the author's PC.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-30T15:45:35Z.
Review: APPROVED
Independent Release check on
dbcc0986: builtcompile_dxiland ranctest --preset release --no-tests=error --output-on-failure -R '^native_direct_mesh$'; 1/1 passed. The new assertion follows both compare/select values intosetMeshOutputCounts, so merely compiling the too-large count cannot satisfy it. The other refusal checks remain in the fixture; the diff changes no compiler source.