GL_INVALID_OPERATION in glVertexAttribPointer


glGetError returns GL_INVALID_OPERATION after the following sequence:


I am not sure why it is happening considering the SDK for glVertexAttribPointer says:

GL_INVALID_OPERATION is generated if zero is bound to the GL_ARRAY_BUFFER buffer object binding point and the pointer argument is not NULL.

In this case, both GL_ARRAY_BUFFER and pointer are null. I suppose the call is not necessary, and I should just call glDisableVertexAttribArray.

Also, I doubt this is the problem, but I am using GLIntercept, and read “OpenGL3.0 + pure core profiles do not work correctly (will be fixed).”

I am using GL 3.3 core profile and tested on both NVIDIA and ATI so I think this is my fault, not a driver issue.


It is definitely true that the DisableVertexAttribArray would be enough.

Also, the GL_ARB_vertex_array_object spec says the following:

An INVALID_OPERATION error is generated if VertexAttribPointer or VertexAttribIPointer is called while a non-zero vertex array object is bound and zero is bound to the ARRAY_BUFFER buffer object binding point.

So the error code seems to be valid here.

Good eye. I thought the VAO may have something to do with it, but I expected to see VAO restrictions in the SDK page for glVertexAttribPointer. Next time, I’ll check both.


With pleasure!

Actually it wouldn’t have been that easy to find if I would have not checked that extension specification just yesterday because I read the issues part :smiley: