swrast: Remove support for rendering antialiased triangles into a color-index buffer
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 24 Feb 2010 23:26:48 +0000 (15:26 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 3 Mar 2010 20:37:03 +0000 (12:37 -0800)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/swrast/s_aatriangle.c
src/mesa/swrast/s_aatritemp.h

index 078f16aea09d2fe93821a84a657235cd20887cea..fe3338ecef888e93eb7973471e9a0be9e890845a 100644 (file)
@@ -357,20 +357,6 @@ rgba_aa_tri(GLcontext *ctx,
            const SWvertex *v2)
 {
 #define DO_Z
-#define DO_RGBA
-#include "s_aatritemp.h"
-}
-
-
-static void
-index_aa_tri(GLcontext *ctx,
-            const SWvertex *v0,
-            const SWvertex *v1,
-            const SWvertex *v2)
-{
-#define DO_Z
-#define DO_ATTRIBS
-#define DO_INDEX
 #include "s_aatritemp.h"
 }
 
@@ -382,7 +368,6 @@ general_aa_tri(GLcontext *ctx,
                const SWvertex *v2)
 {
 #define DO_Z
-#define DO_RGBA
 #define DO_ATTRIBS
 #include "s_aatritemp.h"
 }
@@ -406,11 +391,8 @@ _swrast_set_aa_triangle_function(GLcontext *ctx)
        || NEED_SECONDARY_COLOR(ctx)) {
       SWRAST_CONTEXT(ctx)->Triangle = general_aa_tri;
    }
-   else if (ctx->Visual.rgbMode) {
-      SWRAST_CONTEXT(ctx)->Triangle = rgba_aa_tri;
-   }
    else {
-      SWRAST_CONTEXT(ctx)->Triangle = index_aa_tri;
+      SWRAST_CONTEXT(ctx)->Triangle = rgba_aa_tri;
    }
 
    ASSERT(SWRAST_CONTEXT(ctx)->Triangle);
index 76d4005b8ca82ee75044cbf57d149f617563f047..5c1c6d9044b1f3e33722a75ea23747faefd58c88 100644 (file)
@@ -33,8 +33,6 @@
  * The following macros may be defined to indicate what auxillary information
  * must be copmuted across the triangle:
  *    DO_Z         - if defined, compute Z values
- *    DO_RGBA      - if defined, compute RGBA values
- *    DO_INDEX     - if defined, compute color index values
  *    DO_ATTRIBS   - if defined, compute texcoords, varying, etc.
  */
 
 #ifdef DO_Z
    GLfloat zPlane[4];
 #endif
-#ifdef DO_RGBA
    GLfloat rPlane[4], gPlane[4], bPlane[4], aPlane[4];
-#endif
-#ifdef DO_INDEX
-   GLfloat iPlane[4];
-#endif
 #if defined(DO_ATTRIBS)
    GLfloat attrPlane[FRAG_ATTRIB_MAX][4][4];
    GLfloat wPlane[4];  /* win[3] */
    compute_plane(p0, p1, p2, p0[2], p1[2], p2[2], zPlane);
    span.arrayMask |= SPAN_Z;
 #endif
-#ifdef DO_RGBA
    if (ctx->Light.ShadeModel == GL_SMOOTH) {
       compute_plane(p0, p1, p2, v0->color[RCOMP], v1->color[RCOMP], v2->color[RCOMP], rPlane);
       compute_plane(p0, p1, p2, v0->color[GCOMP], v1->color[GCOMP], v2->color[GCOMP], gPlane);
       constant_plane(v2->color[ACOMP], aPlane);
    }
    span.arrayMask |= SPAN_RGBA;
-#endif
-#ifdef DO_INDEX
-   if (ctx->Light.ShadeModel == GL_SMOOTH) {
-      compute_plane(p0, p1, p2, (GLfloat) v0->attrib[FRAG_ATTRIB_CI][0],
-                    v1->attrib[FRAG_ATTRIB_CI][0], v2->attrib[FRAG_ATTRIB_CI][0], iPlane);
-   }
-   else {
-      constant_plane(v2->attrib[FRAG_ATTRIB_CI][0], iPlane);
-   }
-   span.arrayMask |= SPAN_INDEX;
-#endif
 #if defined(DO_ATTRIBS)
    {
       const GLfloat invW0 = v0->attrib[FRAG_ATTRIB_WPOS][3];
             /* (cx,cy) = center of fragment */
             const GLfloat cx = ix + 0.5F, cy = iy + 0.5F;
             SWspanarrays *array = span.array;
-#ifdef DO_INDEX
-            array->coverage[count] = (GLfloat) compute_coveragei(pMin, pMid, pMax, ix, iy);
-#else
             array->coverage[count] = coverage;
-#endif
 #ifdef DO_Z
             array->z[count] = (GLuint) solve_plane(cx, cy, zPlane);
 #endif
-#ifdef DO_RGBA
             array->rgba[count][RCOMP] = solve_plane_chan(cx, cy, rPlane);
             array->rgba[count][GCOMP] = solve_plane_chan(cx, cy, gPlane);
             array->rgba[count][BCOMP] = solve_plane_chan(cx, cy, bPlane);
             array->rgba[count][ACOMP] = solve_plane_chan(cx, cy, aPlane);
-#endif
-#ifdef DO_INDEX
-            array->index[count] = (GLint) solve_plane(cx, cy, iPlane);
-#endif
             ix++;
             count++;
             coverage = compute_coveragef(pMin, pMid, pMax, ix, iy);
          span.x = startX;
          span.y = iy;
          span.end = (GLuint) ix - (GLuint) startX;
-#if defined(DO_RGBA)
          _swrast_write_rgba_span(ctx, &span);
-#else
-         _swrast_write_index_span(ctx, &span);
-#endif
       }
    }
    else {
             const GLfloat cx = ix + 0.5F, cy = iy + 0.5F;
             SWspanarrays *array = span.array;
             ASSERT(ix >= 0);
-#ifdef DO_INDEX
-            array->coverage[ix] = (GLfloat) compute_coveragei(pMin, pMax, pMid, ix, iy);
-#else
             array->coverage[ix] = coverage;
-#endif
 #ifdef DO_Z
             array->z[ix] = (GLuint) solve_plane(cx, cy, zPlane);
 #endif
-#ifdef DO_RGBA
             array->rgba[ix][RCOMP] = solve_plane_chan(cx, cy, rPlane);
             array->rgba[ix][GCOMP] = solve_plane_chan(cx, cy, gPlane);
             array->rgba[ix][BCOMP] = solve_plane_chan(cx, cy, bPlane);
             array->rgba[ix][ACOMP] = solve_plane_chan(cx, cy, aPlane);
-#endif
-#ifdef DO_INDEX
-            array->index[ix] = (GLint) solve_plane(cx, cy, iPlane);
-#endif
             ix--;
             count++;
             coverage = compute_coveragef(pMin, pMax, pMid, ix, iy);
             GLint j;
             for (j = 0; j < (GLint) n; j++) {
                array->coverage[j] = array->coverage[j + left];
-#ifdef DO_RGBA
                COPY_CHAN4(array->rgba[j], array->rgba[j + left]);
-#endif
-#ifdef DO_INDEX
-               array->index[j] = array->index[j + left];
-#endif
 #ifdef DO_Z
                array->z[j] = array->z[j + left];
 #endif
          span.x = left;
          span.y = iy;
          span.end = n;
-#if defined(DO_RGBA)
          _swrast_write_rgba_span(ctx, &span);
-#else
-         _swrast_write_index_span(ctx, &span);
-#endif
       }
    }
 }
 
 
 #undef DO_Z
-#undef DO_RGBA
-#undef DO_INDEX
 #undef DO_ATTRIBS
 #undef DO_OCCLUSION_TEST