I have a very strange VAO problem on iOS.
The problem is that a freshly created VAO becomes invalid almost immediately after creation.
I have a piece of code that creates a VAO in the usual way using glGenVertexArrayOES(1, &vao). It then binds it (glBindVertexArrayOES), sets up all the vertex bindings etc etc, then binds the zero VAO to ensure that no further glBind calls write to it accidentally. If I call glIsVertexArrayOES(vao) at this point, it returns true.
My code is structured as a job graph, where jobs are pushed into an ordered queue and picked up to execute on a threadpool. Nevertheless, for OpenGL, I only execute code that calls GL on one thread. I've got thread affinities to ensure this.
Now. My code executes, makes a VAO, and exits out of the function. It then picks up the very next job, runs it on the same thread, and tries to use the newly created VAO. If I call glIsVertexArrayOES at this point - literally, almost immediately after construction - it returns false!
Any attempt to ignore that and use it anyway fails.
I've got a breakpoint on glDeleteVertexArraysOES and that's not getting called. It's so odd... it successfully makes a VAO, exits a function, tries to use the newly created VAO on the same thread (thus dodging context and sharegroup issues) and fails.
Any help or insight greatly appreciated!