/**
* ARB version of glBindVertexArray()
*/
-void GLAPIENTRY
-_mesa_BindVertexArray( GLuint id )
+static ALWAYS_INLINE void
+bind_vertex_array(struct gl_context *ctx, GLuint id, bool no_error)
{
- GET_CURRENT_CONTEXT(ctx);
-
- struct gl_vertex_array_object * const oldObj = ctx->Array.VAO;
+ struct gl_vertex_array_object *const oldObj = ctx->Array.VAO;
struct gl_vertex_array_object *newObj = NULL;
assert(oldObj != NULL);
else {
/* non-default array object */
newObj = _mesa_lookup_vao(ctx, id);
- if (!newObj) {
+ if (!no_error && !newObj) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glBindVertexArray(non-gen name)");
return;
}
+void GLAPIENTRY
+_mesa_BindVertexArray(GLuint id)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ bind_vertex_array(ctx, id, false);
+}
+
+
/**
* Delete a set of array objects.
*