[Mesa-dev] [PATCH 05/10] mesa: Remove the now unused _NEW_ARRAY state change flag.

Mathias.Froehlich at gmx.net Mathias.Froehlich at gmx.net
Thu May 2 09:27:15 UTC 2019


From: Mathias Fröhlich <mathias.froehlich at web.de>

Is no longer used, so we have less occasions where NewState is non zero.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich at web.de>
---
 src/mesa/drivers/dri/i965/brw_state_upload.c |  1 -
 src/mesa/main/arrayobj.c                     |  1 -
 src/mesa/main/attrib.c                       |  1 -
 src/mesa/main/debug.c                        |  3 +--
 src/mesa/main/mtypes.h                       |  2 +-
 src/mesa/main/varray.c                       | 17 -----------------
 6 files changed, 2 insertions(+), 23 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c
index 5743fd5b8ae..938b9defeda 100644
--- a/src/mesa/drivers/dri/i965/brw_state_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_state_upload.c
@@ -355,7 +355,6 @@ static struct dirty_bit_map mesa_bits[] = {
    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),
    DEFINE_BIT(_NEW_CURRENT_ATTRIB),
diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index 63138096da6..a6d48f5ffed 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -1049,7 +1049,6 @@ bind_vertex_array(struct gl_context *ctx, GLuint id, bool no_error)
     */
    _mesa_set_draw_vao(ctx, ctx->Array._EmptyVAO, 0);

-   ctx->NewState |= _NEW_ARRAY;
    _mesa_reference_vao(ctx, &ctx->Array.VAO, newObj);
 }

diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index fd130857179..fe6c5a00460 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -1839,7 +1839,6 @@ _mesa_PopClientAttrib(void)
                (struct gl_array_attrib *) node->data;
             restore_array_attrib(ctx, &ctx->Array, attr);
             free_array_attrib_data(ctx, attr);
-            ctx->NewState |= _NEW_ARRAY;
             break;
          }
          default:
diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c
index b1fa1f067ff..db11ae35a25 100644
--- a/src/mesa/main/debug.c
+++ b/src/mesa/main/debug.c
@@ -73,7 +73,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, " : "",
@@ -96,7 +96,6 @@ _mesa_print_state( const char *msg, GLuint state )
 	   (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,, " : "");
 }
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index abe91699a81..0ca87561f05 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -4444,7 +4444,7 @@ struct gl_matrix_stack
 #define _NEW_TRANSFORM         (1u << 17)  /**< gl_context::Transform */
 #define _NEW_VIEWPORT          (1u << 18)  /**< gl_context::Viewport */
 #define _NEW_TEXTURE_STATE     (1u << 19)  /**< gl_context::Texture (states only) */
-#define _NEW_ARRAY             (1u << 20)  /**< gl_context::Array */
+/* gap */
 #define _NEW_RENDERMODE        (1u << 21)  /**< gl_context::RenderMode, etc */
 #define _NEW_BUFFERS           (1u << 22)  /**< gl_context::Visual, DrawBuffer, */
 #define _NEW_CURRENT_ATTRIB    (1u << 23)  /**< gl_context::Current */
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index e6057c7f881..fad0c227d49 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -179,8 +179,6 @@ _mesa_vertex_attrib_binding(struct gl_context *ctx,
       array->BufferBindingIndex = bindingIndex;

       vao->NewArrays |= vao->Enabled & array_bit;
-      if (vao == ctx->Array.VAO)
-         ctx->NewState |= _NEW_ARRAY;
    }
 }

@@ -217,8 +215,6 @@ _mesa_bind_vertex_buffer(struct gl_context *ctx,
       }

       vao->NewArrays |= vao->Enabled & binding->_BoundArrays;
-      if (vao == ctx->Array.VAO)
-         ctx->NewState |= _NEW_ARRAY;
    }
 }

@@ -240,8 +236,6 @@ vertex_binding_divisor(struct gl_context *ctx,
    if (binding->InstanceDivisor != divisor) {
       binding->InstanceDivisor = divisor;
       vao->NewArrays |= vao->Enabled & binding->_BoundArrays;
-      if (vao == ctx->Array.VAO)
-         ctx->NewState |= _NEW_ARRAY;
    }
 }

@@ -360,8 +354,6 @@ _mesa_update_array_format(struct gl_context *ctx,
                            normalized, integer, doubles);

    vao->NewArrays |= vao->Enabled & VERT_BIT(attrib);
-   if (vao == ctx->Array.VAO)
-      ctx->NewState |= _NEW_ARRAY;
 }

 /**
@@ -1098,9 +1090,6 @@ _mesa_enable_vertex_array_attribs(struct gl_context *ctx,
       vao->Enabled |= attrib_bits;
       vao->NewArrays |= attrib_bits;

-      if (vao == ctx->Array.VAO)
-         ctx->NewState |= _NEW_ARRAY;
-
       /* Update the map mode if needed */
       if (attrib_bits & (VERT_BIT_POS|VERT_BIT_GENERIC0))
          update_attribute_map_mode(ctx, vao);
@@ -1185,9 +1174,6 @@ _mesa_disable_vertex_array_attribs(struct gl_context *ctx,
       vao->Enabled &= ~attrib_bits;
       vao->NewArrays |= attrib_bits;

-      if (vao == ctx->Array.VAO)
-         ctx->NewState |= _NEW_ARRAY;
-
       /* Update the map mode if needed */
       if (attrib_bits & (VERT_BIT_POS|VERT_BIT_GENERIC0))
          update_attribute_map_mode(ctx, vao);
@@ -1894,8 +1880,6 @@ _mesa_LockArraysEXT(GLint first, GLsizei count)

    ctx->Array.LockFirst = first;
    ctx->Array.LockCount = count;
-
-   ctx->NewState |= _NEW_ARRAY;
 }


@@ -1914,7 +1898,6 @@ _mesa_UnlockArraysEXT( void )

    ctx->Array.LockFirst = 0;
    ctx->Array.LockCount = 0;
-   ctx->NewState |= _NEW_ARRAY;
 }


--
2.20.1



More information about the mesa-dev mailing list