Commit 55c19527 authored by Brian Paul's avatar Brian Paul

mesa: raise error for glEnable(GL_VERTEX_ARRAY), etc. in core profile

Otherwise, if the call executes normally we'll hit an assertion later
in the VBO code when we draw something.  Note that these cases were
already handled correctly for the glIsEnabled() function (and the API
checks were copied from there).

Tested with new piglit gl-3.1-enable-vertex-array test.

v2: fix compat/es mix-up, per Ilia.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Charmaine Lee's avatarCharmaine Lee <charmainel@vmware.com>
Reviewed-by: Ilia Mirkin's avatarIlia Mirkin <imirkin@alum.mit.edu>
parent a9b2b5e2
......@@ -741,12 +741,22 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
case GL_VERTEX_ARRAY:
case GL_NORMAL_ARRAY:
case GL_COLOR_ARRAY:
case GL_INDEX_ARRAY:
case GL_TEXTURE_COORD_ARRAY:
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
client_state( ctx, cap, state );
return;
case GL_INDEX_ARRAY:
case GL_EDGE_FLAG_ARRAY:
case GL_FOG_COORDINATE_ARRAY_EXT:
case GL_SECONDARY_COLOR_ARRAY_EXT:
if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
client_state( ctx, cap, state );
return;
case GL_POINT_SIZE_ARRAY_OES:
if (ctx->API != API_OPENGLES)
goto invalid_enum_error;
client_state( ctx, cap, state );
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment