remove SWvertex->fog field, use attrib field
authorBrian <brian@nostromo.localnet.net>
Tue, 24 Apr 2007 04:01:34 +0000 (22:01 -0600)
committerBrian <brian@nostromo.localnet.net>
Tue, 24 Apr 2007 04:01:34 +0000 (22:01 -0600)
src/mesa/swrast/s_aalinetemp.h
src/mesa/swrast/s_aatritemp.h
src/mesa/swrast/s_context.c
src/mesa/swrast/s_linetemp.h
src/mesa/swrast/s_pointtemp.h
src/mesa/swrast/s_tritemp.h
src/mesa/swrast/swrast.h

index b0b73e816ddf2af3a39868579c207eb5d45e9748..ef26e9edc8b00e89fdb58e226c123a2eb1791496 100644 (file)
@@ -153,7 +153,9 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
 #ifdef DO_FOG
    line.span.arrayMask |= SPAN_FOG;
    compute_plane(line.x0, line.y0, line.x1, line.y1,
-                 v0->fog, v1->fog, line.fPlane);
+                 v0->attrib[FRAG_ATTRIB_FOGC][0],
+                 v1->attrib[FRAG_ATTRIB_FOGC][0],
+                 line.fPlane);
 #endif
 #ifdef DO_RGBA
    line.span.arrayMask |= SPAN_RGBA;
index f6c8e68a9b7942118b7e02581834c2ba298fee2d..8ff52cb932bb678048c3d62e569e4b747785c7a6 100644 (file)
    span.arrayMask |= SPAN_Z;
 #endif
 #ifdef DO_FOG
-   compute_plane(p0, p1, p2, v0->fog, v1->fog, v2->fog, fogPlane);
+   compute_plane(p0, p1, p2,
+                 v0->attrib[FRAG_ATTRIB_FOGC][0],
+                 v1->attrib[FRAG_ATTRIB_FOGC][0],
+                 v2->attrib[FRAG_ATTRIB_FOGC][0],
+                 fogPlane);
    span.arrayMask |= SPAN_FOG;
 #endif
 #ifdef DO_RGBA
index d4782aacb972eaa98ccdd453dba65f3c6daaed04..522a66fad83605419fa9ba5a5f7bd08ce62496a7 100644 (file)
@@ -910,7 +910,7 @@ _swrast_print_vertex( GLcontext *ctx, const SWvertex *v )
                   v->specular[0], v->specular[1],
                   v->specular[2], v->specular[3]);
 #endif
-      _mesa_debug(ctx, "fog %f\n", v->fog);
+      _mesa_debug(ctx, "fog %f\n", v->attrib[FRAG_ATTRIB_FOGC][0]);
       _mesa_debug(ctx, "index %d\n", v->index);
       _mesa_debug(ctx, "pointsize %f\n", v->pointSize);
       _mesa_debug(ctx, "\n");
index 6c52e8dd478bbdddbc578ae30fb1a39a06380019..76da4467104f525e0c88d1fc1b94473d84cb2b10 100644 (file)
@@ -280,8 +280,9 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 )
 #endif
 #ifdef INTERP_FOG
    interpFlags |= SPAN_FOG;
-   span.attrStart[FRAG_ATTRIB_FOGC][0] = vert0->fog;
-   span.attrStepX[FRAG_ATTRIB_FOGC][0] = (vert1->fog - vert0->fog) / numPixels;
+   span.attrStart[FRAG_ATTRIB_FOGC][0] = vert0->attrib[FRAG_ATTRIB_FOGC][0];
+   span.attrStepX[FRAG_ATTRIB_FOGC][0] = (vert1->attrib[FRAG_ATTRIB_FOGC][0]
+                                          - vert0->attrib[FRAG_ATTRIB_FOGC][0]) / numPixels;
 #endif
 #ifdef INTERP_TEX
    interpFlags |= SPAN_TEXTURE;
index 23ac571236626aed14670da17937c8c363c1fc01..500b3fef9dfb91144deb01608af855fd443c1481 100644 (file)
@@ -105,7 +105,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
     */
    span->interpMask = SPAN_FOG;
    span->arrayMask = SPAN_XY | SPAN_Z;
-   span->attrStart[FRAG_ATTRIB_FOGC][0] = vert->fog;
+   span->attrStart[FRAG_ATTRIB_FOGC][0] = vert->attrib[FRAG_ATTRIB_FOGC][0];
    span->attrStepX[FRAG_ATTRIB_FOGC][0] = 0.0;
    span->attrStepY[FRAG_ATTRIB_FOGC][0] = 0.0;
 #if FLAGS & RGBA
index deab7edbedb9c170972a09bc78bb583802d7f79b..97c79428c06743669be555e0c72c6d7fa7b57d9a 100644 (file)
@@ -458,11 +458,11 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
       {
 #  ifdef INTERP_W
          const GLfloat wMax = vMax->win[3], wMin = vMin->win[3], wMid = vMid->win[3];
-         const GLfloat eMaj_dfog = vMax->fog * wMax - vMin->fog * wMin;
-         const GLfloat eBot_dfog = vMid->fog * wMid - vMin->fog * wMin;
+         const GLfloat eMaj_dfog = vMax->attrib[FRAG_ATTRIB_FOGC][0] * wMax - vMin->attrib[FRAG_ATTRIB_FOGC][0] * wMin;
+         const GLfloat eBot_dfog = vMid->attrib[FRAG_ATTRIB_FOGC][0] * wMid - vMin->attrib[FRAG_ATTRIB_FOGC][0] * wMin;
 #  else
-         const GLfloat eMaj_dfog = vMax->fog - vMin->fog;
-         const GLfloat eBot_dfog = vMid->fog - vMin->fog;
+         const GLfloat eMaj_dfog = vMax->attrib[FRAG_ATTRIB_FOGC][0] - vMin->attrib[FRAG_ATTRIB_FOGC][0];
+         const GLfloat eBot_dfog = vMid->attrib[FRAG_ATTRIB_FOGC][0] - vMin->attrib[FRAG_ATTRIB_FOGC][0];
 #  endif
          span.attrStepX[FRAG_ATTRIB_FOGC][0] = oneOverArea * (eMaj_dfog * eBot.dy - eMaj.dy * eBot_dfog);
          span.attrStepY[FRAG_ATTRIB_FOGC][0] = oneOverArea * (eMaj.dx * eBot_dfog - eMaj_dfog * eBot.dx);
@@ -867,9 +867,9 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
 #endif
 #ifdef INTERP_FOG
 #  ifdef INTERP_W
-               fogLeft = vLower->fog * vLower->win[3] + (span.attrStepX[FRAG_ATTRIB_FOGC][0] * adjx + span.attrStepY[FRAG_ATTRIB_FOGC][0] * adjy) * (1.0F/FIXED_SCALE);
+               fogLeft = vLower->attrib[FRAG_ATTRIB_FOGC][0] * vLower->win[3] + (span.attrStepX[FRAG_ATTRIB_FOGC][0] * adjx + span.attrStepY[FRAG_ATTRIB_FOGC][0] * adjy) * (1.0F/FIXED_SCALE);
 #  else
-               fogLeft = vLower->fog + (span.attrStepX[FRAG_ATTRIB_FOGC][0] * adjx + span.attrStepY[FRAG_ATTRIB_FOGC][0] * adjy) * (1.0F/FIXED_SCALE);
+               fogLeft = vLower->attrib[FRAG_ATTRIB_FOGC][0] + (span.attrStepX[FRAG_ATTRIB_FOGC][0] * adjx + span.attrStepY[FRAG_ATTRIB_FOGC][0] * adjy) * (1.0F/FIXED_SCALE);
 #  endif
                dfogOuter = span.attrStepY[FRAG_ATTRIB_FOGC][0] + dxOuter * span.attrStepX[FRAG_ATTRIB_FOGC][0];
 #endif
index 9e1fe24bb40cf03a04242622148ae6de21d744c8..12264a159ad33ee9b61d74129695a2e206e342d8 100644 (file)
@@ -69,7 +69,6 @@ typedef struct {
    GLfloat win[4];
    GLchan color[4];
    GLchan specular[4];
-   GLfloat fog;
    GLfloat index;
    GLfloat pointSize;
    GLfloat attrib[FRAG_ATTRIB_MAX][4]; /**< texcoords & varying, more to come */