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);
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);
+ }
}
#include "main/mfeatures.h"
#include "main/mtypes.h"
+#include <stdbool.h>
#define _MESA_INIT_EVAL_VTXFMT(vfmt, impl) \
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 );
*/
static void
install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab,
- const GLvertexformat *vfmt)
+ const GLvertexformat *vfmt, bool beginend)
{
assert(ctx->Version > 0);
}
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) {
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);
}
_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);
}