static inline GLboolean
_mesa_inside_dlist_begin_end(const struct gl_context *ctx)
{
- return ctx->Driver.CurrentSavePrimitive != PRIM_OUTSIDE_BEGIN_END;
+ return ctx->Driver.CurrentSavePrimitive <= PRIM_MAX;
}
/* compile this error into the display list */
_mesa_compile_error(ctx, GL_INVALID_ENUM, "glBegin(mode)");
}
- else if (_mesa_inside_dlist_begin_end(ctx) &&
- ctx->Driver.CurrentSavePrimitive != PRIM_UNKNOWN) {
+ else if (_mesa_inside_dlist_begin_end(ctx)) {
/* compile this error into the display list */
_mesa_compile_error(ctx, GL_INVALID_OPERATION, "recursive glBegin");
}
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glEndList\n");
- if (ctx->ExecuteFlag && _mesa_inside_dlist_begin_end(ctx)
- && ctx->Driver.CurrentSavePrimitive != PRIM_UNKNOWN) {
+ if (ctx->ExecuteFlag && _mesa_inside_dlist_begin_end(ctx)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glEndList() called inside glBegin/End");
}