If triangle, that have 2 identical indices is ever passed to meshlet generation, it may result in generation of meshlet with vertex count higher than allowed (maxVerts parameter).
If such triangle is added, UniqueVertexIndices will have 2 identical indices.
It's a problem for code calculating whether triangle fit into meshlet.
newCount may be decremented twice for each vertex instead of once,
resulting in lower newCount than it will actually be added later.
So I propose to just cull degenerate triangles.
That will both fix the issue and result in better generated meshlets in cases input geometry have degenerate triangles.
If triangle, that have 2 identical indices is ever passed to meshlet generation, it may result in generation of meshlet with vertex count higher than allowed (maxVerts parameter). If such triangle is added, UniqueVertexIndices will have 2 identical indices. It's a problem for code calculating whether triangle fit into meshlet. newCount may be decremented twice for each vertex instead of once, resulting in lower newCount than it will actually be added later. So I propose to just cull degenerate triangles. That will both fix the issue and result in better generated meshlets in cases input geometry have degenerate triangles.