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/varray.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/varray.c')
-rw-r--r-- | src/mesa/main/varray.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 7389037ae85..da6bbce52aa 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -777,6 +777,13 @@ _mesa_EnableVertexArrayAttrib(GLuint vaobj, GLuint index) GET_CURRENT_CONTEXT(ctx); struct gl_vertex_array_object *vao; + if (!ctx->Extensions.ARB_direct_state_access) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glEnableVertexArrayAttrib(GL_ARB_direct_state_access " + "is not supported"); + return; + } + /* The ARB_direct_state_access specification says: * * "An INVALID_OPERATION error is generated by EnableVertexArrayAttrib @@ -830,6 +837,13 @@ _mesa_DisableVertexArrayAttrib(GLuint vaobj, GLuint index) GET_CURRENT_CONTEXT(ctx); struct gl_vertex_array_object *vao; + if (!ctx->Extensions.ARB_direct_state_access) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glDisableVertexArrayAttrib(GL_ARB_direct_state_access " + "is not supported"); + return; + } + /* The ARB_direct_state_access specification says: * * "An INVALID_OPERATION error is generated by EnableVertexArrayAttrib @@ -1094,6 +1108,13 @@ _mesa_GetVertexArrayIndexediv(GLuint vaobj, GLuint index, GET_CURRENT_CONTEXT(ctx); struct gl_vertex_array_object *vao; + if (!ctx->Extensions.ARB_direct_state_access) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetVertexArrayIndexediv(GL_ARB_direct_state_access " + "is not supported"); + return; + } + /* The ARB_direct_state_access specification says: * * "An INVALID_OPERATION error is generated if <vaobj> is not @@ -1157,6 +1178,14 @@ _mesa_GetVertexArrayIndexed64iv(GLuint vaobj, GLuint index, GET_CURRENT_CONTEXT(ctx); struct gl_vertex_array_object *vao; + if (!ctx->Extensions.ARB_direct_state_access) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetVertexArrayIndexed64iv(GL_ARB_direct_state_access " + "is not supported"); + return; + } + + /* The ARB_direct_state_access specification says: * * "An INVALID_OPERATION error is generated if <vaobj> is not @@ -1745,6 +1774,13 @@ _mesa_VertexArrayVertexBuffer(GLuint vaobj, GLuint bindingIndex, GLuint buffer, GET_CURRENT_CONTEXT(ctx); struct gl_vertex_array_object *vao; + if (!ctx->Extensions.ARB_direct_state_access) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glVertexArrayVertexBuffer(GL_ARB_direct_state_access " + "is not supported"); + return; + } + /* The ARB_direct_state_access specification says: * * "An INVALID_OPERATION error is generated by VertexArrayVertexBuffer @@ -1910,6 +1946,14 @@ _mesa_VertexArrayVertexBuffers(GLuint vaobj, GLuint first, GLsizei count, GET_CURRENT_CONTEXT(ctx); struct gl_vertex_array_object *vao; + if (!ctx->Extensions.ARB_direct_state_access) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glVertexArrayVertexBuffers(GL_ARB_direct_state_access " + "is not supported"); + return; + } + + /* The ARB_direct_state_access specification says: * * "An INVALID_OPERATION error is generated by VertexArrayVertexBuffer @@ -2018,6 +2062,12 @@ vertex_array_attrib_format(GLuint vaobj, GLuint attribIndex, GLint size, GET_CURRENT_CONTEXT(ctx); struct gl_vertex_array_object *vao; + if (!ctx->Extensions.ARB_direct_state_access) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "%s(GL_ARB_direct_state_access is not supported", func); + return; + } + ASSERT_OUTSIDE_BEGIN_END(ctx); /* The ARB_direct_state_access spec says: @@ -2155,6 +2205,13 @@ _mesa_VertexArrayAttribBinding(GLuint vaobj, GLuint attribIndex, GLuint bindingI GET_CURRENT_CONTEXT(ctx); struct gl_vertex_array_object *vao; + if (!ctx->Extensions.ARB_direct_state_access) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glVertexArrayAttribBinding(GL_ARB_direct_state_access " + "is not supported"); + return; + } + /* The ARB_direct_state_access specification says: * * "An INVALID_OPERATION error is generated by VertexArrayAttribBinding @@ -2229,6 +2286,13 @@ _mesa_VertexArrayBindingDivisor(GLuint vaobj, GLuint bindingIndex, GLuint diviso struct gl_vertex_array_object *vao; GET_CURRENT_CONTEXT(ctx); + if (!ctx->Extensions.ARB_direct_state_access) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glVertexArrayBindingDivisor(GL_ARB_direct_state_access " + "is not supported"); + return; + } + /* The ARB_direct_state_access specification says: * * "An INVALID_OPERATION error is generated by VertexArrayBindingDivisor |