From: Ian Romanick Date: Tue, 19 Feb 2013 23:23:57 +0000 (-0800) Subject: mesa: Don't install glEvalMesh in the beginend dispatch table X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8b586322e71d5ad0ce95d0fbcbfeb4df13f65040;p=mesa.git mesa: Don't install glEvalMesh in the beginend dispatch table NOTE: This is a candidate for the 9.1 branch. Signed-off-by: Ian Romanick Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59740 Reviewed-by: Eric Anholt --- diff --git a/src/mesa/main/eval.c b/src/mesa/main/eval.c index 44b57929e3e..b3c28417593 100644 --- a/src/mesa/main/eval.c +++ b/src/mesa/main/eval.c @@ -824,7 +824,8 @@ _mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, void _mesa_install_eval_vtxfmt(struct _glapi_table *disp, - const GLvertexformat *vfmt) + const GLvertexformat *vfmt, + bool beginend) { SET_EvalCoord1f(disp, vfmt->EvalCoord1f); SET_EvalCoord1fv(disp, vfmt->EvalCoord1fv); @@ -833,8 +834,12 @@ _mesa_install_eval_vtxfmt(struct _glapi_table *disp, SET_EvalPoint1(disp, vfmt->EvalPoint1); SET_EvalPoint2(disp, vfmt->EvalPoint2); - SET_EvalMesh1(disp, vfmt->EvalMesh1); - SET_EvalMesh2(disp, vfmt->EvalMesh2); + /* glEvalMesh1 and glEvalMesh2 are not allowed between glBegin and glEnd. + */ + if (!beginend) { + SET_EvalMesh1(disp, vfmt->EvalMesh1); + SET_EvalMesh2(disp, vfmt->EvalMesh2); + } } diff --git a/src/mesa/main/eval.h b/src/mesa/main/eval.h index 1b6c704ca3b..cfde53fd6ae 100644 --- a/src/mesa/main/eval.h +++ b/src/mesa/main/eval.h @@ -39,6 +39,7 @@ #include "main/mfeatures.h" #include "main/mtypes.h" +#include #define _MESA_INIT_EVAL_VTXFMT(vfmt, impl) \ @@ -76,7 +77,8 @@ extern GLfloat *_mesa_copy_map_points2d(GLenum target, extern void _mesa_install_eval_vtxfmt(struct _glapi_table *disp, - const GLvertexformat *vfmt); + const GLvertexformat *vfmt, + bool beginend); extern void _mesa_init_eval( struct gl_context *ctx ); extern void _mesa_free_eval_data( struct gl_context *ctx ); diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c index 347d07d5727..8669c40079d 100644 --- a/src/mesa/main/vtxfmt.c +++ b/src/mesa/main/vtxfmt.c @@ -45,7 +45,7 @@ */ static void install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, - const GLvertexformat *vfmt) + const GLvertexformat *vfmt, bool beginend) { assert(ctx->Version > 0); @@ -62,7 +62,7 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, } if (ctx->API == API_OPENGL_COMPAT) { - _mesa_install_eval_vtxfmt(tab, vfmt); + _mesa_install_eval_vtxfmt(tab, vfmt, beginend); } if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) { @@ -251,9 +251,9 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, void _mesa_install_exec_vtxfmt(struct gl_context *ctx, const GLvertexformat *vfmt) { - install_vtxfmt( ctx, ctx->Exec, vfmt ); + install_vtxfmt(ctx, ctx->Exec, vfmt, false); if (ctx->BeginEnd) - install_vtxfmt( ctx, ctx->BeginEnd, vfmt ); + install_vtxfmt(ctx, ctx->BeginEnd, vfmt, true); } @@ -265,7 +265,7 @@ void _mesa_install_save_vtxfmt(struct gl_context *ctx, const GLvertexformat *vfmt) { if (_mesa_is_desktop_gl(ctx)) - install_vtxfmt( ctx, ctx->Save, vfmt ); + install_vtxfmt(ctx, ctx->Save, vfmt, false); }