From 9e8a961dd7d7b717a9fb4ecdea1c1b60ea355efe Mon Sep 17 00:00:00 2001 From: Brian Date: Sun, 20 May 2007 12:27:39 -0600 Subject: Overhaul/simplify SWvertex and SWspan attribute handling. Instead of separate fog/specular/texcoord/varying code, just treat all of them as generic attributes. Simplifies the point/line/triangle functions. --- src/mesa/swrast/s_aaline.c | 39 ++++++++++----------------------------- 1 file changed, 10 insertions(+), 29 deletions(-) (limited to 'src/mesa/swrast/s_aaline.c') diff --git a/src/mesa/swrast/s_aaline.c b/src/mesa/swrast/s_aaline.c index 3bb53dc2d7..d6a9afb421 100644 --- a/src/mesa/swrast/s_aaline.c +++ b/src/mesa/swrast/s_aaline.c @@ -59,19 +59,13 @@ struct LineInfo /* DO_Z */ GLfloat zPlane[4]; - /* DO_FOG */ - GLfloat fPlane[4]; /* DO_RGBA */ GLfloat rPlane[4], gPlane[4], bPlane[4], aPlane[4]; /* DO_INDEX */ GLfloat iPlane[4]; - /* DO_SPEC */ - GLfloat srPlane[4], sgPlane[4], sbPlane[4]; /* DO_ATTRIBS */ - GLfloat sPlane[FRAG_ATTRIB_MAX][4]; - GLfloat tPlane[FRAG_ATTRIB_MAX][4]; - GLfloat uPlane[FRAG_ATTRIB_MAX][4]; - GLfloat vPlane[FRAG_ATTRIB_MAX][4]; + GLfloat wPlane[4]; + GLfloat attrPlane[FRAG_ATTRIB_MAX][4][4]; GLfloat lambda[FRAG_ATTRIB_MAX]; GLfloat texWidth[FRAG_ATTRIB_MAX]; GLfloat texHeight[FRAG_ATTRIB_MAX]; @@ -483,35 +477,24 @@ segment(GLcontext *ctx, #define NAME(x) aa_ci_##x #define DO_Z -#define DO_FOG +#define DO_ATTRIBS /* for fog */ #define DO_INDEX #include "s_aalinetemp.h" #define NAME(x) aa_rgba_##x #define DO_Z -#define DO_FOG #define DO_RGBA #include "s_aalinetemp.h" -#define NAME(x) aa_tex_rgba_##x +#define NAME(x) aa_general_rgba_##x #define DO_Z -#define DO_FOG #define DO_RGBA #define DO_ATTRIBS #include "s_aalinetemp.h" -#define NAME(x) aa_multitex_spec_##x -#define DO_Z -#define DO_FOG -#define DO_RGBA -#define DO_ATTRIBS -#define DO_SPEC -#include "s_aalinetemp.h" - - void _swrast_choose_aa_line_function(GLcontext *ctx) @@ -523,14 +506,12 @@ _swrast_choose_aa_line_function(GLcontext *ctx) if (ctx->Visual.rgbMode) { /* RGBA */ if (ctx->Texture._EnabledCoordUnits != 0 - || ctx->FragmentProgram._Current) { - - if (ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR || - ctx->Fog.ColorSumEnabled) - swrast->Line = aa_multitex_spec_line; - else - swrast->Line = aa_tex_rgba_line; - + || ctx->FragmentProgram._Current + || (ctx->Light.Enabled && + ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) + || ctx->Fog.ColorSumEnabled + || swrast->_FogEnabled) { + swrast->Line = aa_general_rgba_line; } else { swrast->Line = aa_rgba_line; -- cgit v1.2.3