summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-02-24 15:17:30 -0800
committerIan Romanick <ian.d.romanick@intel.com>2010-03-03 12:37:03 -0800
commit0ed9c4bc7affb7a6b9be5ff129815fccf8c3885d (patch)
treea24d6436b378fd9f013131ebda51d41d525e2b15 /src
parentd05badba291ce4444b6aaabfd577bdbcf7929193 (diff)
swrast: Remove support for rendering triangles into a color-index buffer
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/swrast/s_triangle.c29
-rw-r--r--src/mesa/swrast/s_tritemp.h50
2 files changed, 4 insertions, 75 deletions
diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c
index 11184b72ce..812dddf15c 100644
--- a/src/mesa/swrast/s_triangle.c
+++ b/src/mesa/swrast/s_triangle.c
@@ -70,18 +70,6 @@ _swrast_culltriangle( GLcontext *ctx,
/*
- * Render a smooth or flat-shaded color index triangle.
- */
-#define NAME ci_triangle
-#define INTERP_Z 1
-#define INTERP_ATTRIBS 1 /* just for fog */
-#define INTERP_INDEX 1
-#define RENDER_SPAN( span ) _swrast_write_index_span(ctx, &span);
-#include "s_tritemp.h"
-
-
-
-/*
* Render a flat-shaded RGBA triangle.
*/
#define NAME flat_rgba_triangle
@@ -1007,7 +995,6 @@ void
_swrast_choose_triangle( GLcontext *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- const GLboolean rgbmode = ctx->Visual.rgbMode;
if (ctx->Polygon.CullFlag &&
ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK) {
@@ -1029,23 +1016,15 @@ _swrast_choose_triangle( GLcontext *ctx )
ctx->Depth.Mask == GL_FALSE &&
ctx->Depth.Func == GL_LESS &&
!ctx->Stencil._Enabled) {
- if ((rgbmode &&
- ctx->Color.ColorMask[0][0] == 0 &&
- ctx->Color.ColorMask[0][1] == 0 &&
- ctx->Color.ColorMask[0][2] == 0 &&
- ctx->Color.ColorMask[0][3] == 0)
- ||
- (!rgbmode && ctx->Color.IndexMask == 0)) {
+ if (ctx->Color.ColorMask[0][0] == 0 &&
+ ctx->Color.ColorMask[0][1] == 0 &&
+ ctx->Color.ColorMask[0][2] == 0 &&
+ ctx->Color.ColorMask[0][3] == 0) {
USE(occlusion_zless_triangle);
return;
}
}
- if (!rgbmode) {
- USE(ci_triangle);
- return;
- }
-
/*
* XXX should examine swrast->_ActiveAttribMask to determine what
* needs to be interpolated.
diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h
index 8e3c5b5eeb..0aa8739f4f 100644
--- a/src/mesa/swrast/s_tritemp.h
+++ b/src/mesa/swrast/s_tritemp.h
@@ -32,7 +32,6 @@
* INTERP_Z - if defined, interpolate integer Z values
* INTERP_RGB - if defined, interpolate integer RGB values
* INTERP_ALPHA - if defined, interpolate integer Alpha values
- * INTERP_INDEX - if defined, interpolate color index values
* INTERP_INT_TEX - if defined, interpolate integer ST texcoords
* (fast, simple 2-D texture mapping, without
* perspective correction)
@@ -319,9 +318,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
{
GLint scan_from_left_to_right; /* true if scanning left-to-right */
-#ifdef INTERP_INDEX
- GLfloat didx, didy;
-#endif
/*
* Execute user-supplied setup code
@@ -398,21 +394,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
# endif
}
#endif /* INTERP_RGB */
-#ifdef INTERP_INDEX
- span.interpMask |= SPAN_INDEX;
- if (ctx->Light.ShadeModel == GL_SMOOTH) {
- GLfloat eMaj_di = vMax->attrib[FRAG_ATTRIB_CI][0] - vMin->attrib[FRAG_ATTRIB_CI][0];
- GLfloat eBot_di = vMid->attrib[FRAG_ATTRIB_CI][0] - vMin->attrib[FRAG_ATTRIB_CI][0];
- didx = oneOverArea * (eMaj_di * eBot.dy - eMaj.dy * eBot_di);
- didy = oneOverArea * (eMaj.dx * eBot_di - eMaj_di * eBot.dx);
- span.indexStep = SignedFloatToFixed(didx);
- }
- else {
- span.interpMask |= SPAN_FLAT;
- didx = didy = 0.0F;
- span.indexStep = 0;
- }
-#endif
#ifdef INTERP_INT_TEX
{
GLfloat eMaj_ds = (vMax->attrib[FRAG_ATTRIB_TEX0][0] - vMin->attrib[FRAG_ATTRIB_TEX0][0]) * S_SCALE;
@@ -531,9 +512,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
#ifdef INTERP_ALPHA
GLint aLeft = 0, fdaOuter = 0, fdaInner;
#endif
-#ifdef INTERP_INDEX
- GLfixed iLeft=0, diOuter=0, diInner;
-#endif
#ifdef INTERP_INT_TEX
GLfixed sLeft=0, dsOuter=0, dsInner;
GLfixed tLeft=0, dtOuter=0, dtInner;
@@ -697,18 +675,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
#endif /* INTERP_RGB */
-#ifdef INTERP_INDEX
- if (ctx->Light.ShadeModel == GL_SMOOTH) {
- iLeft = (GLfixed)(vLower->attrib[FRAG_ATTRIB_CI][0] * FIXED_SCALE
- + didx * adjx + didy * adjy) + FIXED_HALF;
- diOuter = SignedFloatToFixed(didy + dxOuter * didx);
- }
- else {
- ASSERT(ctx->Light.ShadeModel == GL_FLAT);
- iLeft = FloatToFixed(v2->attrib[FRAG_ATTRIB_CI][0]);
- diOuter = 0;
- }
-#endif
#ifdef INTERP_INT_TEX
{
GLfloat s0, t0;
@@ -784,9 +750,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
#ifdef INTERP_ALPHA
fdaInner = fdaOuter + span.alphaStep;
#endif
-#ifdef INTERP_INDEX
- diInner = diOuter + span.indexStep;
-#endif
#ifdef INTERP_INT_TEX
dsInner = dsOuter + span.intTexStep[0];
dtInner = dtOuter + span.intTexStep[1];
@@ -822,9 +785,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
#ifdef INTERP_ALPHA
span.alpha = aLeft;
#endif
-#ifdef INTERP_INDEX
- span.index = iLeft;
-#endif
#ifdef INTERP_INT_TEX
span.intTex[0] = sLeft;
span.intTex[1] = tLeft;
@@ -855,9 +815,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
#ifdef INTERP_ALPHA
CLAMP_INTERPOLANT(alpha, alphaStep, len);
#endif
-#ifdef INTERP_INDEX
- CLAMP_INTERPOLANT(index, indexStep, len);
-#endif
{
RENDER_SPAN( span );
}
@@ -896,9 +853,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
#ifdef INTERP_ALPHA
aLeft += fdaOuter;
#endif
-#ifdef INTERP_INDEX
- iLeft += diOuter;
-#endif
#ifdef INTERP_INT_TEX
sLeft += dsOuter;
tLeft += dtOuter;
@@ -931,9 +885,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
#ifdef INTERP_ALPHA
aLeft += fdaInner;
#endif
-#ifdef INTERP_INDEX
- iLeft += diInner;
-#endif
#ifdef INTERP_INT_TEX
sLeft += dsInner;
tLeft += dtInner;
@@ -967,7 +918,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
#undef INTERP_Z
#undef INTERP_RGB
#undef INTERP_ALPHA
-#undef INTERP_INDEX
#undef INTERP_INT_TEX
#undef INTERP_ATTRIBS