Super weird crash in `glDrawElements` unless `convertToUnIndexedMesh` called

Heya, I’m running Babylon.js 3.3 in Ejecta (javascriptcore + webgl bindings for apple tv and ios devices), and I’ve got a basic scene rendering:

However - the simplest example code crashes Ejecta in glDrawElements, which I think is due to a VBO not being bound. I randomly tried adding this code:

// If we don't do this we get EXC_BAD_ACCESS in glDrawElements in Ejecta

And now the example scene runs perfectly. I don’t know enough about the babylon internals to know what could be causing this - any pointers as to what could be causing the optimized mesh to crash the WebGL engine but the unindexed mesh works correctly?


unindexed will create a mesh based only on vertex buffer. It will be not indexed meaning there will be no index buffer.

Apparently Ejecta has some issues with Index Buffer? One thing you can check is to verify if your mesh has less than 65535 vertices. If not it will require 32 bits indices and that could be the issue