summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/arrayobj.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-07-18 18:08:47 +0200
committerSamuel Pitoiset <[email protected]>2017-07-31 13:53:39 +0200
commit81fa33171d041491fd262238ce299404ab4fac25 (patch)
treec836dfa8740d7a4d0f2de954d4d73523635a56ac /src/mesa/main/arrayobj.c
parentc88649246f85415073cc8fd922ab039a067c89ee (diff)
mesa: add bind_vertex_array() helper
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa/main/arrayobj.c')
-rw-r--r--src/mesa/main/arrayobj.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index af6a17daeca..fcc7990ef0d 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -392,12 +392,10 @@ _mesa_all_buffers_are_unmapped(const struct gl_vertex_array_object *vao)
/**
* 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);
@@ -417,7 +415,7 @@ _mesa_BindVertexArray( GLuint id )
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;
@@ -446,6 +444,14 @@ _mesa_BindVertexArray( GLuint id )
}
+void GLAPIENTRY
+_mesa_BindVertexArray(GLuint id)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ bind_vertex_array(ctx, id, false);
+}
+
+
/**
* Delete a set of array objects.
*