mesa: don't use _NEW_TEXTURE mainly in mesa/main
authorMarek Olšák <marek.olsak@amd.com>
Thu, 23 Mar 2017 21:59:08 +0000 (22:59 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 29 Mar 2017 13:44:00 +0000 (15:44 +0200)
v2: add missing %s

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/mesa/drivers/dri/i965/brw_state_upload.c
src/mesa/main/attrib.c
src/mesa/main/debug.c
src/mesa/main/state.c
src/mesa/main/texstate.c

index f22567d..9c0b82c 100644 (file)
@@ -585,9 +585,10 @@ static struct dirty_bit_map mesa_bits[] = {
    DEFINE_BIT(_NEW_POLYGONSTIPPLE),
    DEFINE_BIT(_NEW_SCISSOR),
    DEFINE_BIT(_NEW_STENCIL),
-   DEFINE_BIT(_NEW_TEXTURE),
+   DEFINE_BIT(_NEW_TEXTURE_OBJECT),
    DEFINE_BIT(_NEW_TRANSFORM),
    DEFINE_BIT(_NEW_VIEWPORT),
+   DEFINE_BIT(_NEW_TEXTURE_STATE),
    DEFINE_BIT(_NEW_ARRAY),
    DEFINE_BIT(_NEW_RENDERMODE),
    DEFINE_BIT(_NEW_BUFFERS),
index ada2203..8e738c9 100644 (file)
@@ -1385,7 +1385,7 @@ _mesa_PopAttrib(void)
                struct texture_state *texstate
                   = (struct texture_state *) attr->data;
                pop_texture_group(ctx, texstate);
-              ctx->NewState |= _NEW_TEXTURE;
+              ctx->NewState |= _NEW_TEXTURE_OBJECT | _NEW_TEXTURE_STATE;
             }
             break;
          case GL_VIEWPORT_BIT:
index 3471b26..7b76a94 100644 (file)
@@ -72,7 +72,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\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%s\n",
           msg,
           state,
           (state & _NEW_MODELVIEW)       ? "ctx->ModelView, " : "",
@@ -91,9 +91,10 @@ _mesa_print_state( const char *msg, GLuint state )
           (state & _NEW_POLYGONSTIPPLE)  ? "ctx->PolygonStipple, " : "",
           (state & _NEW_SCISSOR)         ? "ctx->Scissor, " : "",
           (state & _NEW_STENCIL)         ? "ctx->Stencil, " : "",
-          (state & _NEW_TEXTURE)         ? "ctx->Texture, " : "",
+          (state & _NEW_TEXTURE_OBJECT)  ? "ctx->Texture(Object), " : "",
           (state & _NEW_TRANSFORM)       ? "ctx->Transform, " : "",
           (state & _NEW_VIEWPORT)        ? "ctx->Viewport, " : "",
+           (state & _NEW_TEXTURE_STATE)   ? "ctx->Texture(State), " : "",
           (state & _NEW_ARRAY)           ? "ctx->Array, " : "",
           (state & _NEW_RENDERMODE)      ? "ctx->RenderMode, " : "",
           (state & _NEW_BUFFERS)         ? "ctx->Visual, ctx->DrawBuffer,, " : "");
index 71265a5..07629d8 100644 (file)
@@ -384,15 +384,15 @@ _mesa_update_state_locked( struct gl_context *ctx )
 
    /* Determine which state flags effect vertex/fragment program state */
    if (ctx->FragmentProgram._MaintainTexEnvProgram) {
-      prog_flags |= (_NEW_BUFFERS | _NEW_TEXTURE | _NEW_FOG |
+      prog_flags |= (_NEW_BUFFERS | _NEW_TEXTURE_OBJECT | _NEW_FOG |
                     _NEW_VARYING_VP_INPUTS | _NEW_LIGHT | _NEW_POINT |
                     _NEW_RENDERMODE | _NEW_PROGRAM | _NEW_FRAG_CLAMP |
-                    _NEW_COLOR);
+                    _NEW_COLOR | _NEW_TEXTURE_STATE);
    }
    if (ctx->VertexProgram._MaintainTnlProgram) {
-      prog_flags |= (_NEW_VARYING_VP_INPUTS | _NEW_TEXTURE |
+      prog_flags |= (_NEW_VARYING_VP_INPUTS | _NEW_TEXTURE_OBJECT |
                      _NEW_TEXTURE_MATRIX | _NEW_TRANSFORM | _NEW_POINT |
-                     _NEW_FOG | _NEW_LIGHT |
+                     _NEW_FOG | _NEW_LIGHT | _NEW_TEXTURE_STATE |
                      _MESA_NEW_NEED_EYE_COORDS);
    }
 
@@ -409,7 +409,7 @@ _mesa_update_state_locked( struct gl_context *ctx )
    if (new_state & _NEW_TEXTURE_MATRIX)
       _mesa_update_texture_matrices(ctx);
 
-   if (new_state & (_NEW_TEXTURE | _NEW_PROGRAM))
+   if (new_state & (_NEW_TEXTURE_OBJECT | _NEW_TEXTURE_STATE | _NEW_PROGRAM))
       _mesa_update_texture_state(ctx);
 
    if (new_state & _NEW_POLYGON)
index 87c4d4a..ada0dfd 100644 (file)
@@ -350,8 +350,8 @@ _mesa_ClientActiveTexture(GLenum texture)
 /**
  * \note This routine refers to derived texture attribute values to
  * compute the ENABLE_TEXMAT flags, but is only called on
- * _NEW_TEXTURE_MATRIX.  On changes to _NEW_TEXTURE, the ENABLE_TEXMAT
- * flags are updated by _mesa_update_textures(), below.
+ * _NEW_TEXTURE_MATRIX.  On changes to _NEW_TEXTURE_OBJECT/STATE,
+ * the ENABLE_TEXMAT flags are updated by _mesa_update_textures(), below.
  *
  * \param ctx GL context.
  */
@@ -686,8 +686,9 @@ update_ff_texture_state(struct gl_context *ctx,
 /**
  * \note This routine refers to derived texture matrix values to
  * compute the ENABLE_TEXMAT flags, but is only called on
- * _NEW_TEXTURE.  On changes to _NEW_TEXTURE_MATRIX, the ENABLE_TEXMAT
- * flags are updated by _mesa_update_texture_matrices, above.
+ * _NEW_TEXTURE_OBJECT/STATE.  On changes to _NEW_TEXTURE_MATRIX,
+ * the ENABLE_TEXMAT flags are updated by _mesa_update_texture_matrices,
+ * above.
  *
  * \param ctx GL context.
  */
@@ -711,7 +712,7 @@ _mesa_update_texture_state(struct gl_context *ctx)
    }
 
    /* TODO: only set this if there are actual changes */
-   ctx->NewState |= _NEW_TEXTURE;
+   ctx->NewState |= _NEW_TEXTURE_OBJECT | _NEW_TEXTURE_STATE;
 
    ctx->Texture._GenFlags = 0x0;
    ctx->Texture._TexMatEnabled = 0x0;