From 7aed2b0c30c6d29d70efd2402a68a8e3de98418c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 10 Mar 2009 20:14:32 -0600 Subject: swrast: remove old texture_apply() code; always use texture combine code --- src/mesa/swrast/s_context.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'src/mesa/swrast/s_context.c') diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 0257abc34ac..56bf2033ca6 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; + } } } } -- cgit v1.2.3