glDrawArrays without VAO for procedural geometry using gl_VertexID, doesn't work in debug context

I’ve been using glDrawArrays to render triangles that cover the whole screen by generating the vertex positions in the vertex shader using gl_VertexID (as done in the FXAA whitepaper http://developer.download.nvidia.com/assets/gamedev/files/sdk/11/FXAA_WhitePaper.pdf).

// drawcall, no VAO bound
glDrawArrays( GL_TRIANGLES, 0, 3 );

// vertex shader
out vec2 vTexCoord;

void main()
{
	vTexCoord   = vec2( (gl_VertexID << 1) & 2, gl_VertexID & 2 );
	gl_Position = vec4( vTexCoord * 2.0 - 1.0, 0.0, 1.0 );
}

This happens to work fine in a normal OpenGL context, glGetError() reports GL_NO_ERROR as expected.
But i get the following error when using a debug context with debug output:

“GL_INVALID_OPERATION error generated. Array object is not active.”

Is this a driver bug?

I didn’t get any errors under DX11 and the glDrawArrays documentation doesn’t mention any GL_INVALID_OPERATION errors for inactive VAOs (http://www.opengl.org/sdk/docs/man/xhtml/glDrawArrays.xml).

After digging around some more, i found this in the OpenGL wiki (http://www.opengl.org/wiki_132/index.php/Vertex_Rendering):

“A non-zero Vertex Array Object must be bound (though no arrays have to be enabled, so it can be a freshly-created vertex array object).”

And everything works fine now :)

Yes I confirm what you said.
In order to do this, it is important to bind an empty VAO.
What I usually do is generating a VAO, don’t fill anything in it, and bind it everytime I need to use my shaders which don’t need any vertex input.
It is the correct way to do this (at least in openGL ;) ) for special effects with shaders for example, like FXAA.