[Mesa-dev] [PATCH 11/11] mesa: Remove set but not used gl_client_array::Stride.

Mathias.Froehlich at gmx.net Mathias.Froehlich at gmx.net
Fri Jun 17 18:04:23 UTC 2016


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

The field is only read for printing today and
there it was probably a leftover.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich at web.de>
---
 src/mesa/main/mtypes.h                   | 1 -
 src/mesa/main/varray.c                   | 1 -
 src/mesa/main/varray.h                   | 1 -
 src/mesa/state_tracker/st_cb_rasterpos.c | 1 -
 src/mesa/vbo/vbo_context.c               | 1 -
 src/mesa/vbo/vbo_exec_draw.c             | 1 -
 src/mesa/vbo/vbo_save_draw.c             | 1 -
 src/mesa/vbo/vbo_split_copy.c            | 3 +--
 8 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index f7f797b..26bc2e8 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1320,7 +1320,6 @@ struct gl_client_array
    GLint Size;                  /**< components per element (1,2,3,4) */
    GLenum Type;                 /**< datatype: GL_FLOAT, GL_INT, etc */
    GLenum Format;               /**< default: GL_RGBA, but may be GL_BGRA */
-   GLsizei Stride;		/**< user-specified stride */
    GLsizei StrideB;		/**< actual stride in bytes */
    GLuint _ElementSize;         /**< size of each element in bytes */
    const GLubyte *Ptr;          /**< Points to array data */
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 6eb2265..b092117 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -2319,7 +2319,6 @@ _mesa_copy_client_array(struct gl_context *ctx,
    dst->Size = src->Size;
    dst->Type = src->Type;
    dst->Format = src->Format;
-   dst->Stride = src->Stride;
    dst->StrideB = src->StrideB;
    dst->Ptr = src->Ptr;
    dst->Normalized = src->Normalized;
diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h
index cacb093..638408b 100644
--- a/src/mesa/main/varray.h
+++ b/src/mesa/main/varray.h
@@ -62,7 +62,6 @@ _mesa_update_client_array(struct gl_context *ctx,
    dst->Size = src->Size;
    dst->Type = src->Type;
    dst->Format = src->Format;
-   dst->Stride = src->Stride;
    dst->StrideB = binding->Stride;
    dst->Ptr = _mesa_vertex_attrib_address(src, binding);
    dst->Normalized = src->Normalized;
diff --git a/src/mesa/state_tracker/st_cb_rasterpos.c b/src/mesa/state_tracker/st_cb_rasterpos.c
index fc7c07d..29c1484 100644
--- a/src/mesa/state_tracker/st_cb_rasterpos.c
+++ b/src/mesa/state_tracker/st_cb_rasterpos.c
@@ -196,7 +196,6 @@ new_draw_rastpos_stage(struct gl_context *ctx, struct draw_context *draw)
       rs->array[i].Size = 4;
       rs->array[i].Type = GL_FLOAT;
       rs->array[i].Format = GL_RGBA;
-      rs->array[i].Stride = 0;
       rs->array[i].StrideB = 0;
       rs->array[i].Ptr = (GLubyte *) ctx->Current.Attrib[i];
       rs->array[i].Normalized = GL_TRUE;
diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c
index 9bceaf4..7a5bd51 100644
--- a/src/mesa/vbo/vbo_context.c
+++ b/src/mesa/vbo/vbo_context.c
@@ -55,7 +55,6 @@ init_array(struct gl_context *ctx, struct gl_client_array *cl,
    cl->Size = size;
    cl->Type = GL_FLOAT;
    cl->Format = GL_RGBA;
-   cl->Stride = 0;
    cl->StrideB = 0;
    cl->_ElementSize = cl->Size * sizeof(GLfloat);
    cl->Ptr = pointer;
diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c
index 7f3e1e8..f6ae863 100644
--- a/src/mesa/vbo/vbo_exec_draw.c
+++ b/src/mesa/vbo/vbo_exec_draw.c
@@ -247,7 +247,6 @@ vbo_exec_bind_arrays( struct gl_context *ctx )
          }
 	 arrays[attr].Size = exec->vtx.attrsz[src];
 	 arrays[attr].StrideB = exec->vtx.vertex_size * sizeof(GLfloat);
-	 arrays[attr].Stride = exec->vtx.vertex_size * sizeof(GLfloat);
 	 arrays[attr].Type = exec->vtx.attrtype[src];
 	 arrays[attr].Integer =
                vbo_attrtype_to_integer_flag(exec->vtx.attrtype[src]);
diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c
index 3424b78..507ab82 100644
--- a/src/mesa/vbo/vbo_save_draw.c
+++ b/src/mesa/vbo/vbo_save_draw.c
@@ -196,7 +196,6 @@ static void vbo_bind_vertex_list(struct gl_context *ctx,
 	 arrays[attr].Ptr = (const GLubyte *) NULL + buffer_offset;
 	 arrays[attr].Size = node_attrsz[src];
 	 arrays[attr].StrideB = node->vertex_size * sizeof(GLfloat);
-	 arrays[attr].Stride = node->vertex_size * sizeof(GLfloat);
          arrays[attr].Type = node_attrtype[src];
          arrays[attr].Integer =
                vbo_attrtype_to_integer_flag(node_attrtype[src]);
diff --git a/src/mesa/vbo/vbo_split_copy.c b/src/mesa/vbo/vbo_split_copy.c
index 084110c..daa09c2 100644
--- a/src/mesa/vbo/vbo_split_copy.c
+++ b/src/mesa/vbo/vbo_split_copy.c
@@ -161,7 +161,7 @@ dump_draw_info(struct gl_context *ctx,
 		arrays[j]->Size, arrays[j]->Type, arrays[j]->StrideB);
          if (0) {
             GLint k = prims[i].start + prims[i].count - 1;
-            GLfloat *last = (GLfloat *) (arrays[j]->Ptr + arrays[j]->Stride * k);
+            GLfloat *last = (GLfloat *) (arrays[j]->Ptr + arrays[j]->StrideB * k);
             printf("        last: %f %f %f\n",
 		   last[0], last[1], last[2]);
          }
@@ -527,7 +527,6 @@ replay_init( struct copy_context *copy )
       dst->Size = src->Size;
       dst->Type = src->Type;
       dst->Format = GL_RGBA;
-      dst->Stride = copy->vertex_size;
       dst->StrideB = copy->vertex_size;
       dst->Ptr = copy->dstbuf + offset;
       dst->Normalized = src->Normalized; 
-- 
2.5.5



More information about the mesa-dev mailing list