summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_context.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-03-10 20:14:32 -0600
committerBrian Paul <brianp@vmware.com>2009-04-01 20:24:22 -0600
commit7aed2b0c30c6d29d70efd2402a68a8e3de98418c (patch)
tree454915e6f04311a3bfeb79dd1d2a5e1f47736c4c /src/mesa/swrast/s_context.c
parent84b24efe8dc1bd67680f4d3c656fb4693fd405c1 (diff)
swrast: remove old texture_apply() code; always use texture combine code
Diffstat (limited to 'src/mesa/swrast/s_context.c')
-rw-r--r--src/mesa/swrast/s_context.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 0257abc34a..56bf2033ca 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -172,19 +172,29 @@ _swrast_update_fog_hint( GLcontext *ctx )
/**
- * Update the swrast->_AnyTextureCombine flag.
+ * Update the swrast->_TextureCombinePrimary flag.
*/
static void
_swrast_update_texture_env( GLcontext *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLuint i;
- swrast->_AnyTextureCombine = GL_FALSE;
+
+ swrast->_TextureCombinePrimary = GL_FALSE;
+
for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
- if (ctx->Texture.Unit[i].EnvMode == GL_COMBINE_EXT ||
- ctx->Texture.Unit[i].EnvMode == GL_COMBINE4_NV) {
- swrast->_AnyTextureCombine = GL_TRUE;
- return;
+ const struct gl_tex_env_combine_state *combine =
+ ctx->Texture.Unit[i]._CurrentCombine;
+ GLuint term;
+ for (term = 0; term < combine->_NumArgsRGB; term++) {
+ if (combine->SourceRGB[term] == GL_PRIMARY_COLOR) {
+ swrast->_TextureCombinePrimary = GL_TRUE;
+ return;
+ }
+ if (combine->SourceA[term] == GL_PRIMARY_COLOR) {
+ swrast->_TextureCombinePrimary = GL_TRUE;
+ return;
+ }
}
}
}