-/* $Id: s_aatriangle.c,v 1.29 2003/01/25 18:57:13 brianp Exp $ */
-
/*
* 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"),
#include "glheader.h"
+#include "context.h"
#include "colormac.h"
+#include "context.h"
#include "macros.h"
#include "imports.h"
-#include "mmath.h"
#include "s_aatriangle.h"
#include "s_context.h"
#include "s_span.h"
#define DO_Z
#define DO_FOG
#define DO_RGBA
-#define DO_TEX
+#define DO_ATTRIBS
#include "s_aatritemp.h"
}
#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
* appropriate antialiased triangle rasterizer function.
*/
void
-_mesa_set_aa_triangle_function(GLcontext *ctx)
+_swrast_set_aa_triangle_function(GLcontext *ctx)
{
ASSERT(ctx->Polygon.SmoothFlag);
- if (ctx->Texture._EnabledUnits != 0) {
- if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) {
- if (ctx->Texture._EnabledUnits > 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._EnabledUnits > 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) {