mesa: remove _NEW_PACKUNPACK
authorMarek Olšák <maraeo@gmail.com>
Mon, 15 Apr 2013 00:23:37 +0000 (02:23 +0200)
committerMarek Olšák <maraeo@gmail.com>
Wed, 24 Apr 2013 01:23:23 +0000 (03:23 +0200)
No driver checks the flag. Nobody uses it.

I also removed the FLUSH_VERTICES calls, because PixelStorei has no effect
on rendering.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_state_upload.c
src/mesa/main/attrib.c
src/mesa/main/debug.c
src/mesa/main/mtypes.h
src/mesa/main/pixelstore.c
src/mesa/state_tracker/st_atom.c

index 80a460512576c2cedfb65771ff0e828c0f5f212a..270b3f46b8be67099ecaf843cb05f3f9506d979f 100644 (file)
@@ -335,7 +335,6 @@ static struct dirty_bit_map mesa_bits[] = {
    DEFINE_BIT(_NEW_TEXTURE),
    DEFINE_BIT(_NEW_TRANSFORM),
    DEFINE_BIT(_NEW_VIEWPORT),
-   DEFINE_BIT(_NEW_PACKUNPACK),
    DEFINE_BIT(_NEW_ARRAY),
    DEFINE_BIT(_NEW_RENDERMODE),
    DEFINE_BIT(_NEW_BUFFERS),
index 14159cf2f0783e3374302eda5ffec5a3fde3c8b2..7734da98756db2824789cae2da9627d6a73c5a43 100644 (file)
@@ -1577,7 +1577,6 @@ _mesa_PopClientAttrib(void)
                copy_pixelstore(ctx, &ctx->Pack, store);
                _mesa_reference_buffer_object(ctx, &store->BufferObj, NULL);
             }
-           ctx->NewState |= _NEW_PACKUNPACK;
             break;
          case GL_CLIENT_UNPACK_BIT:
             {
@@ -1586,7 +1585,6 @@ _mesa_PopClientAttrib(void)
                copy_pixelstore(ctx, &ctx->Unpack, store);
                _mesa_reference_buffer_object(ctx, &store->BufferObj, NULL);
             }
-           ctx->NewState |= _NEW_PACKUNPACK;
             break;
          case GL_CLIENT_VERTEX_ARRAY_BIT: {
            struct gl_array_attrib * attr =
index 5dda766b934a643f67676a3fae90c011910226f0..bfd3d850db40ccb6263f27dca1c6b6c2145a927b 100644 (file)
@@ -66,7 +66,7 @@ void
 _mesa_print_state( const char *msg, GLuint state )
 {
    _mesa_debug(NULL,
-          "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
+          "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
           msg,
           state,
           (state & _NEW_MODELVIEW)       ? "ctx->ModelView, " : "",
@@ -88,7 +88,6 @@ _mesa_print_state( const char *msg, GLuint state )
           (state & _NEW_TEXTURE)         ? "ctx->Texture, " : "",
           (state & _NEW_TRANSFORM)       ? "ctx->Transform, " : "",
           (state & _NEW_VIEWPORT)        ? "ctx->Viewport, " : "",
-          (state & _NEW_PACKUNPACK)      ? "ctx->Pack/Unpack, " : "",
           (state & _NEW_ARRAY)           ? "ctx->Array, " : "",
           (state & _NEW_RENDERMODE)      ? "ctx->RenderMode, " : "",
           (state & _NEW_BUFFERS)         ? "ctx->Visual, ctx->DrawBuffer,, " : "");
index 42b26fd138aff79572824eb726d24ba6ffd347d4..1d12809a4c601c779fe8d74cd3dc709fcb20b750 100644 (file)
@@ -3137,7 +3137,7 @@ struct gl_matrix_stack
 #define _NEW_TEXTURE           (1 << 16)  /**< gl_context::Texture */
 #define _NEW_TRANSFORM         (1 << 17)  /**< gl_context::Transform */
 #define _NEW_VIEWPORT          (1 << 18)  /**< gl_context::Viewport */
-#define _NEW_PACKUNPACK        (1 << 19)  /**< gl_context::Pack, Unpack */
+/* gap, re-use for core Mesa state only; use ctx->DriverFlags otherwise */
 #define _NEW_ARRAY             (1 << 20)  /**< gl_context::Array */
 #define _NEW_RENDERMODE        (1 << 21)  /**< gl_context::RenderMode, etc */
 #define _NEW_BUFFERS           (1 << 22)  /**< gl_context::Visual, DrawBuffer, */
index 5635beff6ab9b4e197c88c16ffad6d3062a949ce..41424cc182f96f98c9cd4c10413d8bd7ab234c6c 100644 (file)
@@ -47,7 +47,6 @@ _mesa_PixelStorei( GLenum pname, GLint param )
             goto invalid_enum_error;
         if (param == (GLint)ctx->Pack.SwapBytes)
            return;
-        FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
          ctx->Pack.SwapBytes = param ? GL_TRUE : GL_FALSE;
         break;
       case GL_PACK_LSB_FIRST:
@@ -55,7 +54,6 @@ _mesa_PixelStorei( GLenum pname, GLint param )
             goto invalid_enum_error;
         if (param == (GLint)ctx->Pack.LsbFirst)
            return;
-        FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
          ctx->Pack.LsbFirst = param ? GL_TRUE : GL_FALSE;
         break;
       case GL_PACK_ROW_LENGTH:
@@ -67,7 +65,6 @@ _mesa_PixelStorei( GLenum pname, GLint param )
         }
         if (ctx->Pack.RowLength == param)
            return;
-        FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
         ctx->Pack.RowLength = param;
         break;
       case GL_PACK_IMAGE_HEIGHT:
@@ -79,7 +76,6 @@ _mesa_PixelStorei( GLenum pname, GLint param )
         }
         if (ctx->Pack.ImageHeight == param)
            return;
-        FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
         ctx->Pack.ImageHeight = param;
          break;
       case GL_PACK_SKIP_PIXELS:
@@ -91,7 +87,6 @@ _mesa_PixelStorei( GLenum pname, GLint param )
         }
         if (ctx->Pack.SkipPixels == param)
            return;
-        FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
         ctx->Pack.SkipPixels = param;
         break;
       case GL_PACK_SKIP_ROWS:
@@ -103,7 +98,6 @@ _mesa_PixelStorei( GLenum pname, GLint param )
         }
         if (ctx->Pack.SkipRows == param)
            return;
-        FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
         ctx->Pack.SkipRows = param;
         break;
       case GL_PACK_SKIP_IMAGES:
@@ -115,7 +109,6 @@ _mesa_PixelStorei( GLenum pname, GLint param )
         }
         if (ctx->Pack.SkipImages == param)
            return;
-        FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
         ctx->Pack.SkipImages = param;
         break;
       case GL_PACK_ALIGNMENT:
@@ -125,7 +118,6 @@ _mesa_PixelStorei( GLenum pname, GLint param )
         }
         if (ctx->Pack.Alignment == param)
            return;
-        FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
         ctx->Pack.Alignment = param;
         break;
       case GL_PACK_INVERT_MESA:
@@ -137,7 +129,6 @@ _mesa_PixelStorei( GLenum pname, GLint param )
          }
          if (ctx->Pack.Invert == param)
             return;
-         FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
          ctx->Pack.Invert = param;
          break;
 
@@ -148,7 +139,6 @@ _mesa_PixelStorei( GLenum pname, GLint param )
            return;
         if ((GLint)ctx->Unpack.SwapBytes == param)
            return;
-        FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
         ctx->Unpack.SwapBytes = param ? GL_TRUE : GL_FALSE;
          break;
       case GL_UNPACK_LSB_FIRST:
@@ -158,7 +148,6 @@ _mesa_PixelStorei( GLenum pname, GLint param )
            return;
         if ((GLint)ctx->Unpack.LsbFirst == param)
            return;
-        FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
         ctx->Unpack.LsbFirst = param ? GL_TRUE : GL_FALSE;
         break;
       case GL_UNPACK_ROW_LENGTH:
@@ -170,7 +159,6 @@ _mesa_PixelStorei( GLenum pname, GLint param )
         }
         if (ctx->Unpack.RowLength == param)
            return;
-        FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
         ctx->Unpack.RowLength = param;
         break;
       case GL_UNPACK_IMAGE_HEIGHT:
@@ -183,7 +171,6 @@ _mesa_PixelStorei( GLenum pname, GLint param )
         if (ctx->Unpack.ImageHeight == param)
            return;
 
-        FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
         ctx->Unpack.ImageHeight = param;
          break;
       case GL_UNPACK_SKIP_PIXELS:
@@ -195,7 +182,6 @@ _mesa_PixelStorei( GLenum pname, GLint param )
         }
         if (ctx->Unpack.SkipPixels == param)
            return;
-        FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
         ctx->Unpack.SkipPixels = param;
         break;
       case GL_UNPACK_SKIP_ROWS:
@@ -207,7 +193,6 @@ _mesa_PixelStorei( GLenum pname, GLint param )
         }
         if (ctx->Unpack.SkipRows == param)
            return;
-        FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
         ctx->Unpack.SkipRows = param;
         break;
       case GL_UNPACK_SKIP_IMAGES:
@@ -219,7 +204,6 @@ _mesa_PixelStorei( GLenum pname, GLint param )
         }
         if (ctx->Unpack.SkipImages == param)
            return;
-        FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
         ctx->Unpack.SkipImages = param;
         break;
       case GL_UNPACK_ALIGNMENT:
@@ -229,7 +213,6 @@ _mesa_PixelStorei( GLenum pname, GLint param )
         }
         if (ctx->Unpack.Alignment == param)
            return;
-        FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
         ctx->Unpack.Alignment = param;
         break;
       default:
index 7d3839243004bb83eedbf7ca27885f78d2e88ef5..1abaf8f3e9103a2b2091402c4d24637cd36a4148 100644 (file)
@@ -160,11 +160,7 @@ void st_validate_state( struct st_context *st )
 
    check_attrib_edgeflag(st);
 
-   /* The bitmap cache is immune to pixel unpack changes.
-    * Note that GLUT makes several calls to glPixelStore for each
-    * bitmap char it draws so this is an important check.
-    */
-   if (state->mesa & ~_NEW_PACKUNPACK)
+   if (state->mesa)
       st_flush_bitmap_cache(st);
 
    check_program_state( st );