Can VAO 0 be used as the default vertex array object in OpenGL core profile?
0 reputation · 17 Jun 2021, 11:32 UTC
Goal: determine whether VAO 0 can be treated as a portable default vertex array object for vertex attribute and draw calls in OpenGL core profile contexts, compared with compatibility profile contexts.
OpenGL 3.1 and later core profiles require a non-zero VAO to be bound before glVertexAttribPointer or glDrawArrays; VAO 0 is not specified as a usable default object. Compatibility profiles retain VAO 0 as the default vertex array object. Driver behavior differs when VAO 0 is bound in a core profile: some implementations accept it silently, while others generate GL_INVALID_OPERATION. The specification leaves the outcome implementation-dependent, so results may vary by GPU vendor, driver version, and context creation flags.
Does binding VAO 0 in a core profile context satisfy the VAO binding requirement for glVertexAttribPointer and glDrawArrays? Is VAO 0 guaranteed to act as a valid default vertex array object across core-profile drivers? Can the same vertex-state code rely on VAO 0 when a windowing system exposes both core and compatibility contexts?