When an Indexed mesh is used, as soon as
Mesh.setIndices is called, the global SubMesh is recreated with
When unindexed Mesh is used, there is no call to
Mesh.setIndices, we call
Mesh.setVerticesData and in this case the global SubMesh is recreated only if the new vertexCount is lower than the previous one (because we call
Buf for an unindexed Mesh, setting the vertexBuffer is the same as setting the index buffer of an indexed Mesh.
repro here : Babylon.js Playground