diff options
author | Fredrik Höglund <[email protected]> | 2015-05-10 20:54:18 +0200 |
---|---|---|
committer | Fredrik Höglund <[email protected]> | 2015-05-14 15:48:17 +0200 |
commit | 36b05793372b86b914d9b95d0188f5f387e01d68 (patch) | |
tree | 5df4e311618ab53bab862c0c6bdb3e20f51a4cf1 /src/mesa/main/arrayobj.c | |
parent | 8940957238e8584ce27295791cee4cc3d6f7cf1e (diff) |
mesa: Add ARB_direct_state_access checks in VAO functions
Signed-off-by: Fredrik Höglund <[email protected]>
Reviewed-by: Adam Jackson <[email protected]>
Diffstat (limited to 'src/mesa/main/arrayobj.c')
-rw-r--r-- | src/mesa/main/arrayobj.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c index 7c4004043de..320f435ea94 100644 --- a/src/mesa/main/arrayobj.c +++ b/src/mesa/main/arrayobj.c @@ -617,6 +617,14 @@ void GLAPIENTRY _mesa_CreateVertexArrays(GLsizei n, GLuint *arrays) { GET_CURRENT_CONTEXT(ctx); + + if (!ctx->Extensions.ARB_direct_state_access) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glCreateVertexArrays(GL_ARB_direct_state_access " + "is not supported"); + return; + } + gen_vertex_arrays(ctx, n, arrays, true, "glCreateVertexArrays"); } @@ -659,6 +667,13 @@ _mesa_VertexArrayElementBuffer(GLuint vaobj, GLuint buffer) struct gl_vertex_array_object *vao; struct gl_buffer_object *bufObj; + if (!ctx->Extensions.ARB_direct_state_access) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glVertexArrayElementBuffer(GL_ARB_direct_state_access " + "is not supported"); + return; + } + ASSERT_OUTSIDE_BEGIN_END(ctx); /* The GL_ARB_direct_state_access specification says: @@ -695,6 +710,13 @@ _mesa_GetVertexArrayiv(GLuint vaobj, GLenum pname, GLint *param) ASSERT_OUTSIDE_BEGIN_END(ctx); + if (!ctx->Extensions.ARB_direct_state_access) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetVertexArrayiv(GL_ARB_direct_state_access " + "is not supported"); + return; + } + /* The GL_ARB_direct_state_access specification says: * * "An INVALID_OPERATION error is generated if <vaobj> is not |