The code crash in glDrawElements. After checking, it will be fine if CC_ENABLE_GL_STATE_CACHE is 0.
I think there is a problem in ccGLBindVAO(m_uVAOname); It seems it doesn’t actually bind due to state unchanged (but actually changed.), with the modification below, it works even with CC_ENABLE_GL_STATE_CACHE = 1
void ccGLBindVAO(GLuint vaoId)
if (s_uVAO != vaoId)
s_uVAO = vaoId;
#endif // CC_ENABLE_GL_STATE_CACHE
It seems it is better than disable the state cache function, but still don’t know why.