Repository navigation
shader: expect clamped mesh output counts in native_direct_mesh - #3616
Merged
Merged
Conversation
R0Y00#3537 replaced the "mesh count exchange exceeds declared range" refusal with a clamp to the declared output range, but the too-many-primitives case still expected the refusal, so native_direct_mesh failed on main. The case now checks that the vertex and primitive counts are clamped to 3 and 1 and that the clamped values reach setMeshOutputCounts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 30, 2026
R0Y00
approved these changes
Nov 30, 2026
R0Y00
left a comment
Owner
There was a problem hiding this comment.
Independent Release check on dbcc0986: built compile_dxil and ran ctest --preset release --no-tests=error --output-on-failure -R '^native_direct_mesh$'; 1/1 passed. The new assertion follows both compare/select values into setMeshOutputCounts, so merely compiling the too-large count cannot satisfy it. The other refusal checks remain in the fixture; the diff changes no compiler source.
This was referenced Nov 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 617ce7c (#3537) reverse-applied, the updated case fails with
native 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