mesa: fix CurrentSavePrimitive <= GL_POLYGON tests
authorBrian Paul <brianp@vmware.com>
Thu, 2 May 2013 01:15:32 +0000 (19:15 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 2 May 2013 15:03:14 +0000 (09:03 -0600)
Use the new PRIM_MAX value instead so that new geometry shader primitive
types are accounted for.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/mesa/main/dlist.c
src/mesa/vbo/vbo_save_api.c

index 3071a37e14b5aa60d1ce4170f912d12c75197fb8..9eb13fb385efa24f83a6c1a73471cf30fd8ed01b 100644 (file)
@@ -122,7 +122,7 @@ do {                                                \
  */
 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval)         \
 do {                                                                   \
-   if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON ||               \
+   if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX ||                 \
        ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
       _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
       return retval;                                                   \
@@ -137,7 +137,7 @@ do {                                                                        \
  */
 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx)                             \
 do {                                                                   \
-   if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON ||               \
+   if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX ||                 \
        ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
       _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
       return;                                                          \
index 7ede8f4b7cb4a7bc19379582dca7efe25cfabb51..52293ce09a597ae24112a26ba708c822583c0c36 100644 (file)
@@ -1516,7 +1516,7 @@ vbo_save_SaveFlushVertices(struct gl_context *ctx)
    /* Noop when we are actually active:
     */
    if (ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM ||
-       ctx->Driver.CurrentSavePrimitive <= GL_POLYGON)
+       ctx->Driver.CurrentSavePrimitive <= PRIM_MAX)
       return;
 
    if (save->vert_count || save->prim_count)