remove rgb[] array from span_arrays_struct - was only used in a few places
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 21 Sep 2006 23:19:40 +0000 (23:19 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 21 Sep 2006 23:19:40 +0000 (23:19 +0000)
src/mesa/swrast/s_context.h
src/mesa/swrast/s_drawpix.c
src/mesa/swrast/s_triangle.c

index 3c5a4c32228572d7d08db37c2e5c0a7640995a47..76f08b007ea9749ab587ae9c4eed26c1f2f74e8d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5
+ * Version:  6.5.2
  *
  * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
  *
  * These arrays are separated out of sw_span to conserve memory.
  */
 struct span_arrays {
-   /* XXX the next three fields could go into a union */
-   GLchan  rgb[MAX_WIDTH][3];
    GLchan  rgba[MAX_WIDTH][4];
-   GLuint  index[MAX_WIDTH];
    GLchan  spec[MAX_WIDTH][4]; /* specular color */
+   GLuint  index[MAX_WIDTH];
    GLint   x[MAX_WIDTH];  /**< X/Y used for point/line rendering only */
    GLint   y[MAX_WIDTH];  /**< X/Y used for point/line rendering only */
    GLuint  z[MAX_WIDTH];
index cfe516733f1ca643002fdbd0bc138b82683afe85..cf8adbe40a96f35c08afa71354bfdf77da83a0da 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5.1
+ * Version:  6.5.2
  *
  * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
  *
@@ -243,14 +243,14 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
                GLint row;
                ASSERT(drawWidth <= MAX_WIDTH);
                for (row=0; row<drawHeight; row++) {
+                  GLchan rgb[MAX_WIDTH][3];
                   GLint i;
                  for (i=0;i<drawWidth;i++) {
-                     span.array->rgb[i][0] = src[i];
-                     span.array->rgb[i][1] = src[i];
-                     span.array->rgb[i][2] = src[i];
+                     rgb[i][0] = src[i];
+                     rgb[i][1] = src[i];
+                     rgb[i][2] = src[i];
                  }
-                  rb->PutRowRGB(ctx, rb, drawWidth, destX, destY,
-                                span.array->rgb, NULL);
+                  rb->PutRowRGB(ctx, rb, drawWidth, destX, destY, rgb, NULL);
                   src += rowLength;
                   destY++;
                }
@@ -260,15 +260,15 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
                GLint row;
                ASSERT(drawWidth <= MAX_WIDTH);
                for (row=0; row<drawHeight; row++) {
+                  GLchan rgb[MAX_WIDTH][3];
                   GLint i;
                   for (i=0;i<drawWidth;i++) {
-                     span.array->rgb[i][0] = src[i];
-                     span.array->rgb[i][1] = src[i];
-                     span.array->rgb[i][2] = src[i];
+                     rgb[i][0] = src[i];
+                     rgb[i][1] = src[i];
+                     rgb[i][2] = src[i];
                   }
                   destY--;
-                  rb->PutRow(ctx, rb, drawWidth, destX, destY,
-                             span.array->rgb, NULL);
+                  rb->PutRow(ctx, rb, drawWidth, destX, destY, rgb, NULL);
                   src += rowLength;
                }
             }
@@ -277,17 +277,18 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
                GLint row;
                ASSERT(drawWidth <= MAX_WIDTH);
                for (row=0; row<drawHeight; row++) {
+                  GLchan rgb[MAX_WIDTH][3];
                   GLint i;
                  for (i=0;i<drawWidth;i++) {
-                     span.array->rgb[i][0] = src[i];
-                     span.array->rgb[i][1] = src[i];
-                     span.array->rgb[i][2] = src[i];
+                     rgb[i][0] = src[i];
+                     rgb[i][1] = src[i];
+                     rgb[i][2] = src[i];
                  }
                   span.x = destX;
                   span.y = destY;
                   span.end = drawWidth;
                   _swrast_write_zoomed_rgb_span(ctx, imgX, imgY, &span,
-                             (CONST GLchan (*)[3]) span.array->rgb);
+                             (CONST GLchan (*)[3]) rgb);
                   src += rowLength;
                   destY++;
                }
index a1cbd881a73e9fd15f949d8b4a925900a0678878..440345fb1265de07493d1794a56a496824b58d07 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5
+ * Version:  6.5.2
  *
  * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
  *
@@ -163,6 +163,7 @@ _swrast_culltriangle( GLcontext *ctx,
 
 #define RENDER_SPAN( span )                                            \
    GLuint i;                                                           \
+   GLchan rgb[MAX_WIDTH][3];                                           \
    span.intTex[0] -= FIXED_HALF; /* off-by-one error? */               \
    span.intTex[1] -= FIXED_HALF;                                       \
    for (i = 0; i < span.end; i++) {                                    \
@@ -170,13 +171,13 @@ _swrast_culltriangle( GLcontext *ctx,
       GLint t = FixedToInt(span.intTex[1]) & tmask;                    \
       GLint pos = (t << twidth_log2) + s;                              \
       pos = pos + pos + pos;  /* multiply by 3 */                      \
-      span.array->rgb[i][RCOMP] = texture[pos];                                \
-      span.array->rgb[i][GCOMP] = texture[pos+1];                      \
-      span.array->rgb[i][BCOMP] = texture[pos+2];                      \
+      rgb[i][RCOMP] = texture[pos];                                    \
+      rgb[i][GCOMP] = texture[pos+1];                                  \
+      rgb[i][BCOMP] = texture[pos+2];                                  \
       span.intTex[0] += span.intTexStep[0];                            \
       span.intTex[1] += span.intTexStep[1];                            \
    }                                                                   \
-   rb->PutRowRGB(ctx, rb, span.end, span.x, span.y, span.array->rgb, NULL);
+   rb->PutRowRGB(ctx, rb, span.end, span.x, span.y, rgb, NULL);
 
 #include "s_tritemp.h"
 
@@ -214,6 +215,7 @@ _swrast_culltriangle( GLcontext *ctx,
 
 #define RENDER_SPAN( span )                                            \
    GLuint i;                                                           \
+   GLchan rgb[MAX_WIDTH][3];                                           \
    span.intTex[0] -= FIXED_HALF; /* off-by-one error? */               \
    span.intTex[1] -= FIXED_HALF;                                       \
    for (i = 0; i < span.end; i++) {                                    \
@@ -223,9 +225,9 @@ _swrast_culltriangle( GLcontext *ctx,
          GLint t = FixedToInt(span.intTex[1]) & tmask;                 \
          GLint pos = (t << twidth_log2) + s;                           \
          pos = pos + pos + pos;  /* multiply by 3 */                   \
-         span.array->rgb[i][RCOMP] = texture[pos];                     \
-         span.array->rgb[i][GCOMP] = texture[pos+1];                   \
-         span.array->rgb[i][BCOMP] = texture[pos+2];                   \
+         rgb[i][RCOMP] = texture[pos];                                 \
+         rgb[i][GCOMP] = texture[pos+1];                               \
+         rgb[i][BCOMP] = texture[pos+2];                               \
          zRow[i] = z;                                                  \
          span.array->mask[i] = 1;                                      \
       }                                                                        \
@@ -236,8 +238,7 @@ _swrast_culltriangle( GLcontext *ctx,
       span.intTex[1] += span.intTexStep[1];                            \
       span.z += span.zStep;                                            \
    }                                                                   \
-   rb->PutRowRGB(ctx, rb, span.end, span.x, span.y,                    \
-                 span.array->rgb, span.array->mask);
+   rb->PutRowRGB(ctx, rb, span.end, span.x, span.y, rgb, span.array->mask);
 
 #include "s_tritemp.h"