summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2016-05-23 10:28:24 -0600
committerBrian Paul <brianp@vmware.com>2016-05-24 10:26:26 -0600
commit55c19527a6c28e6a7d8984f6cb6d9ce9d553a5c3 (patch)
treed0650f6fab4b22d770072fa7e0088c49ed8056cc
parenta9b2b5e24112c5aa6e5a82e72bc209e269359c20 (diff)
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 <charmainel@vmware.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
-rw-r--r--src/mesa/main/enable.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index d2830770ec..1d674bf39f 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -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;