diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2003-12-09 01:53:03 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2003-12-09 01:53:03 +0000 |
commit | 853bda3e7c4dfa7d8cc462729f6a3dce89e44963 (patch) | |
tree | 9fdbf1812276c8f1f2bb8e56d82d0d163e22eae0 /src/mesa/swrast/s_context.c | |
parent | e8bec8832b50b8c2310e40951bea8bd78f89715c (diff) |
Update NEED_SECONDARY_COLOR macro to test if either vertex/fragment
programs are enabled and if they need secondary color input register.
Patch by Karl Rasche, with tweaks by Brian.
Diffstat (limited to 'src/mesa/swrast/s_context.c')
-rw-r--r-- | src/mesa/swrast/s_context.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index fb09eb3060..c69d4cfd5d 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -30,6 +30,7 @@ #include "context.h" #include "mtypes.h" #include "texobj.h" +#include "nvfragprog.h" #include "swrast.h" #include "s_blend.h" @@ -226,7 +227,9 @@ _swrast_validate_triangle( GLcontext *ctx, _swrast_validate_derived( ctx ); swrast->choose_triangle( ctx ); - if (ctx->Texture._EnabledUnits == 0 && NEED_SECONDARY_COLOR(ctx)) { + if (ctx->Texture._EnabledUnits == 0 + && NEED_SECONDARY_COLOR(ctx) + && !ctx->FragmentProgram.Enabled) { /* separate specular color, but no texture */ swrast->SpecTriangle = swrast->Triangle; swrast->Triangle = _swrast_add_spec_terms_triangle; @@ -243,7 +246,9 @@ _swrast_validate_line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 ) _swrast_validate_derived( ctx ); swrast->choose_line( ctx ); - if (ctx->Texture._EnabledUnits == 0 && NEED_SECONDARY_COLOR(ctx)) { + if (ctx->Texture._EnabledUnits == 0 + && NEED_SECONDARY_COLOR(ctx) + && !ctx->FragmentProgram.Enabled) { swrast->SpecLine = swrast->Line; swrast->Line = _swrast_add_spec_terms_line; } @@ -260,7 +265,9 @@ _swrast_validate_point( GLcontext *ctx, const SWvertex *v0 ) _swrast_validate_derived( ctx ); swrast->choose_point( ctx ); - if (ctx->Texture._EnabledUnits == 0 && NEED_SECONDARY_COLOR(ctx)) { + if (ctx->Texture._EnabledUnits == 0 + && NEED_SECONDARY_COLOR(ctx) + && !ctx->FragmentProgram.Enabled) { swrast->SpecPoint = swrast->Point; swrast->Point = _swrast_add_spec_terms_point; } |