mesa: Branch 'master' - 3 commits

Brian Paul brianp at kemper.freedesktop.org
Tue Apr 24 04:04:02 UTC 2007


 src/mesa/swrast/s_aalinetemp.h     |    4 +++-
 src/mesa/swrast/s_aatritemp.h      |    6 +++++-
 src/mesa/swrast/s_context.c        |    4 +++-
 src/mesa/swrast/s_linetemp.h       |    5 +++--
 src/mesa/swrast/s_pointtemp.h      |    2 +-
 src/mesa/swrast/s_tritemp.h        |   12 ++++++------
 src/mesa/swrast/swrast.h           |    1 -
 src/mesa/swrast_setup/ss_context.c |    4 ++--
 8 files changed, 23 insertions(+), 15 deletions(-)

New commits:
diff-tree 3db3dc58bcc361637d7473ee4b7c4e3b036c283c (from c27adc52ce48d371b94170581be173b77c16e6e6)
Author: Brian <brian at nostromo.localnet.net>
Date:   Mon Apr 23 22:04:03 2007 -0600

    disable some errant code

diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 522a66f..c55de89 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -520,10 +520,12 @@ _swrast_update_fragment_attribs(GLcontex
       GLuint u;
       attribsMask = 0x0;
 
+#if 0 /* not yet */
       if (ctx->Depth.Test)
          attribsMask |= FRAG_BIT_WPOS;
       if (NEED_SECONDARY_COLOR(ctx))
          attribsMask |= FRAG_BIT_COL1;
+#endif
       if (swrast->_FogEnabled)
          attribsMask |= FRAG_BIT_FOGC;
 
diff-tree c27adc52ce48d371b94170581be173b77c16e6e6 (from afc132e7a9c2b2c870b61ef10311272b36ea9bf2)
Author: Brian <brian at nostromo.localnet.net>
Date:   Mon Apr 23 22:03:11 2007 -0600

    remove SWvertex->fog field, use attrib field

diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c
index 075f779..360cc61 100644
--- a/src/mesa/swrast_setup/ss_context.c
+++ b/src/mesa/swrast_setup/ss_context.c
@@ -132,7 +132,7 @@ setup_vertex_format(GLcontext *ctx)
          EMIT_ATTR( _TNL_ATTRIB_COLOR_INDEX, EMIT_1F, index );
 
       if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG ))
-         EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1F, fog);
+         EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1F, attrib[FRAG_ATTRIB_FOGC]);
 
       if (RENDERINPUTS_TEST_RANGE(index_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX))
       {
@@ -277,7 +277,7 @@ _swsetup_Translate( GLcontext *ctx, cons
    UNCLAMPED_FLOAT_TO_RGBA_CHAN( dest->specular, tmp );
 
    _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_FOG, tmp );
-   dest->fog = tmp[0];
+   dest->attrib[FRAG_ATTRIB_FOGC][0] = tmp[0];
 
    _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR_INDEX, tmp );
    dest->index = tmp[0];
diff-tree afc132e7a9c2b2c870b61ef10311272b36ea9bf2 (from 335769a875d653f6076e653d3f63c6a4ba64dba2)
Author: Brian <brian at nostromo.localnet.net>
Date:   Mon Apr 23 22:01:34 2007 -0600

    remove SWvertex->fog field, use attrib field

diff --git a/src/mesa/swrast/s_aalinetemp.h b/src/mesa/swrast/s_aalinetemp.h
index b0b73e8..ef26e9e 100644
--- a/src/mesa/swrast/s_aalinetemp.h
+++ b/src/mesa/swrast/s_aalinetemp.h
@@ -153,7 +153,9 @@ NAME(line)(GLcontext *ctx, const SWverte
 #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;
diff --git a/src/mesa/swrast/s_aatritemp.h b/src/mesa/swrast/s_aatritemp.h
index f6c8e68..8ff52cb 100644
--- a/src/mesa/swrast/s_aatritemp.h
+++ b/src/mesa/swrast/s_aatritemp.h
@@ -136,7 +136,11 @@
    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
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index d4782aa..522a66f 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -910,7 +910,7 @@ _swrast_print_vertex( GLcontext *ctx, co
                   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");
diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h
index 6c52e8d..76da446 100644
--- a/src/mesa/swrast/s_linetemp.h
+++ b/src/mesa/swrast/s_linetemp.h
@@ -280,8 +280,9 @@ NAME( GLcontext *ctx, const SWvertex *ve
 #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;
diff --git a/src/mesa/swrast/s_pointtemp.h b/src/mesa/swrast/s_pointtemp.h
index 23ac571..500b3fe 100644
--- a/src/mesa/swrast/s_pointtemp.h
+++ b/src/mesa/swrast/s_pointtemp.h
@@ -105,7 +105,7 @@ NAME ( GLcontext *ctx, const SWvertex *v
     */
    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
diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h
index deab7ed..97c7942 100644
--- a/src/mesa/swrast/s_tritemp.h
+++ b/src/mesa/swrast/s_tritemp.h
@@ -458,11 +458,11 @@ static void NAME(GLcontext *ctx, const S
       {
 #  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 S
 #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
diff --git a/src/mesa/swrast/swrast.h b/src/mesa/swrast/swrast.h
index 9e1fe24..12264a1 100644
--- a/src/mesa/swrast/swrast.h
+++ b/src/mesa/swrast/swrast.h
@@ -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 */



More information about the mesa-commit mailing list