summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_context.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2003-09-18 23:21:08 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2003-09-18 23:21:08 +0000
commit29b4076f9acff96a867760fc885f5eaeb7586977 (patch)
tree8257664555bea58b6f9f2ebc4e3d0f2ddce719c3 /src/mesa/swrast/s_context.c
parent1a8ebb8c2f939609004a13b75d2b85236e709716 (diff)
Move away from using the ctx->_TriangleCaps bitfield.
New macros in context.h for testing state: NEED_SECONDARY_COLOR and NEED_TWO_SIDED_LIGHTING.
Diffstat (limited to 'src/mesa/swrast/s_context.c')
-rw-r--r--src/mesa/swrast/s_context.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 9e429aef85..99da79afd5 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -226,8 +226,8 @@ _swrast_validate_triangle( GLcontext *ctx,
_swrast_validate_derived( ctx );
swrast->choose_triangle( ctx );
- if ((ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) &&
- ctx->Texture._EnabledUnits == 0) {
+ if (ctx->Texture._EnabledUnits == 0 && NEED_SECONDARY_COLOR(ctx)) {
+ /* separate specular color, but no texture */
swrast->SpecTriangle = swrast->Triangle;
swrast->Triangle = _swrast_add_spec_terms_triangle;
}
@@ -243,8 +243,7 @@ _swrast_validate_line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 )
_swrast_validate_derived( ctx );
swrast->choose_line( ctx );
- if ((ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) &&
- ctx->Texture._EnabledUnits == 0) {
+ if (ctx->Texture._EnabledUnits == 0 && NEED_SECONDARY_COLOR(ctx)) {
swrast->SpecLine = swrast->Line;
swrast->Line = _swrast_add_spec_terms_line;
}
@@ -261,8 +260,7 @@ _swrast_validate_point( GLcontext *ctx, const SWvertex *v0 )
_swrast_validate_derived( ctx );
swrast->choose_point( ctx );
- if ((ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) &&
- ctx->Texture._EnabledUnits == 0) {
+ if (ctx->Texture._EnabledUnits == 0 && NEED_SECONDARY_COLOR(ctx)) {
swrast->SpecPoint = swrast->Point;
swrast->Point = _swrast_add_spec_terms_point;
}