diff options
Diffstat (limited to 'mesalib/src/mesa/main/dlist.c')
-rw-r--r-- | mesalib/src/mesa/main/dlist.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mesalib/src/mesa/main/dlist.c b/mesalib/src/mesa/main/dlist.c index 420ddcc0c..f113573d8 100644 --- a/mesalib/src/mesa/main/dlist.c +++ b/mesalib/src/mesa/main/dlist.c @@ -5767,10 +5767,16 @@ save_Begin(GLenum mode) Node *n; GLboolean error = GL_FALSE; - if (!_mesa_valid_prim_mode(ctx, mode)) { - _mesa_compile_error(ctx, GL_INVALID_ENUM, "glBegin(mode)"); + if (mode > GL_POLYGON) { + _mesa_error(ctx, GL_INVALID_ENUM, "glBegin(mode=%x)", mode); error = GL_TRUE; } + if (ctx->ExecuteFlag) { + if (!_mesa_valid_prim_mode(ctx, mode, "glBegin")) { + error = GL_TRUE; + } + } + else if (ctx->Driver.CurrentSavePrimitive == PRIM_UNKNOWN) { /* Typically the first begin. This may raise an error on * playback, depending on whether CallList is issued from inside |