r300: Further reduced the radeon_span.c diff.
[mesa.git] / src / mesa / swrast / s_aatriangle.c
index 21b8c0437efe8f37f79ec557dfb7bd424d20bdc9..0d95f06a9de8609b755e55e429ddcc4ee1d06e1a 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * Mesa 3-D graphics library
- * Version:  5.1
+ * Version:  6.5.3
  *
- * Copyright (C) 1999-2003  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -29,7 +29,9 @@
 
 
 #include "glheader.h"
+#include "context.h"
 #include "colormac.h"
+#include "context.h"
 #include "macros.h"
 #include "imports.h"
 #include "s_aatriangle.h"
@@ -406,7 +408,7 @@ tex_aa_tri(GLcontext *ctx,
 #define DO_Z
 #define DO_FOG
 #define DO_RGBA
-#define DO_TEX
+#define DO_ATTRIBS
 #include "s_aatritemp.h"
 }
 
@@ -420,39 +422,12 @@ spec_tex_aa_tri(GLcontext *ctx,
 #define DO_Z
 #define DO_FOG
 #define DO_RGBA
-#define DO_TEX
+#define DO_ATTRIBS
 #define DO_SPEC
 #include "s_aatritemp.h"
 }
 
 
-static void
-multitex_aa_tri(GLcontext *ctx,
-               const SWvertex *v0,
-               const SWvertex *v1,
-               const SWvertex *v2)
-{
-#define DO_Z
-#define DO_FOG
-#define DO_RGBA
-#define DO_MULTITEX
-#include "s_aatritemp.h"
-}
-
-static void
-spec_multitex_aa_tri(GLcontext *ctx,
-                    const SWvertex *v0,
-                    const SWvertex *v1,
-                    const SWvertex *v2)
-{
-#define DO_Z
-#define DO_FOG
-#define DO_RGBA
-#define DO_MULTITEX
-#define DO_SPEC
-#include "s_aatritemp.h"
-}
-
 
 /*
  * Examine GL state and set swrast->Triangle to an
@@ -463,22 +438,13 @@ _swrast_set_aa_triangle_function(GLcontext *ctx)
 {
    ASSERT(ctx->Polygon.SmoothFlag);
 
-   if (ctx->Texture._EnabledCoordUnits != 0) {
-      if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) {
-         if (ctx->Texture._EnabledCoordUnits > 1) {
-            SWRAST_CONTEXT(ctx)->Triangle = spec_multitex_aa_tri;
-         }
-         else {
-            SWRAST_CONTEXT(ctx)->Triangle = spec_tex_aa_tri;
-         }
+   if (ctx->Texture._EnabledCoordUnits != 0
+       || ctx->FragmentProgram._Current) {
+      if (NEED_SECONDARY_COLOR(ctx)) {
+         SWRAST_CONTEXT(ctx)->Triangle = spec_tex_aa_tri;
       }
       else {
-         if (ctx->Texture._EnabledCoordUnits > 1) {
-            SWRAST_CONTEXT(ctx)->Triangle = multitex_aa_tri;
-         }
-         else {
-            SWRAST_CONTEXT(ctx)->Triangle = tex_aa_tri;
-         }
+         SWRAST_CONTEXT(ctx)->Triangle = tex_aa_tri;
       }
    }
    else if (ctx->Visual.rgbMode) {