diff options
author | Timothy Arceri <[email protected]> | 2017-06-28 14:03:07 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-06-29 08:54:11 +1000 |
commit | 73e0140acc118e0a53ac601adba9fe85833ff32c (patch) | |
tree | eb2e201c15a7ec932c2b0b37a57b01798292b567 /src/mesa/main/varray.c | |
parent | d731b189335545abeb71b1cfc8b0562370d68d87 (diff) |
mesa: move error handling into disable_vertex_array_attrib() callers
This will let us just call disable_vertex_array_attrib() for
KHR_no_error support.
Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/mesa/main/varray.c')
-rw-r--r-- | src/mesa/main/varray.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index b193544d1a1..fcc9a31c896 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -1141,14 +1141,8 @@ _mesa_EnableVertexArrayAttrib_no_error(GLuint vaobj, GLuint index) static void disable_vertex_array_attrib(struct gl_context *ctx, struct gl_vertex_array_object *vao, - GLuint index, - const char *func) + GLuint index) { - if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) { - _mesa_error(ctx, GL_INVALID_VALUE, "%s(index)", func); - return; - } - assert(VERT_ATTRIB_GENERIC(index) < ARRAY_SIZE(vao->VertexAttrib)); if (vao->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Enabled) { @@ -1165,8 +1159,13 @@ void GLAPIENTRY _mesa_DisableVertexAttribArray(GLuint index) { GET_CURRENT_CONTEXT(ctx); - disable_vertex_array_attrib(ctx, ctx->Array.VAO, index, - "glDisableVertexAttribArray"); + + if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) { + _mesa_error(ctx, GL_INVALID_VALUE, "glDisableVertexAttribArray(index)"); + return; + } + + disable_vertex_array_attrib(ctx, ctx->Array.VAO, index); } @@ -1187,7 +1186,12 @@ _mesa_DisableVertexArrayAttrib(GLuint vaobj, GLuint index) if (!vao) return; - disable_vertex_array_attrib(ctx, vao, index, "glDisableVertexArrayAttrib"); + if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) { + _mesa_error(ctx, GL_INVALID_VALUE, "glDisableVertexArrayAttrib(index)"); + return; + } + + disable_vertex_array_attrib(ctx, vao, index); } |