diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2009-07-17 14:46:40 -0400 |
---|---|---|
committer | Alex Deucher <alexdeucher@gmail.com> | 2009-07-17 14:46:40 -0400 |
commit | e910f6831b4e7033a0d5cbd83bdab191d622bad0 (patch) | |
tree | f5a386cad3583d60757e2837418b734f09e76295 /src/mesa/main | |
parent | 79a170108f1d9cad949cd2a34e4de597beae72db (diff) | |
parent | 30bccf8ea9cd84d1a52a31b6f86b783dfb919374 (diff) | |
download | external_mesa3d-e910f6831b4e7033a0d5cbd83bdab191d622bad0.zip external_mesa3d-e910f6831b4e7033a0d5cbd83bdab191d622bad0.tar.gz external_mesa3d-e910f6831b4e7033a0d5cbd83bdab191d622bad0.tar.bz2 |
Merge branch 'master' of git+ssh://agd5f@git.freedesktop.org/git/mesa/mesa into r6xx-rewrite
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/state.c | 2 | ||||
-rw-r--r-- | src/mesa/main/texenvprogram.c | 18 |
2 files changed, 16 insertions, 4 deletions
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 9ba131b..d8191ab 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -546,7 +546,7 @@ _mesa_update_state_locked( GLcontext *ctx ) /* Determine which state flags effect vertex/fragment program state */ if (ctx->FragmentProgram._MaintainTexEnvProgram) { - prog_flags |= (_NEW_TEXTURE | _NEW_FOG | _DD_NEW_SEPARATE_SPECULAR | + prog_flags |= (_NEW_TEXTURE | _NEW_FOG | _NEW_ARRAY | _NEW_LIGHT | _NEW_POINT | _NEW_RENDERMODE); } if (ctx->VertexProgram._MaintainTnlProgram) { diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index a3f1246..6b090ff 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -62,6 +62,18 @@ struct texenvprog_cache_item struct texenvprog_cache_item *next; }; +static GLboolean +texenv_doing_secondary_color(GLcontext *ctx) +{ + if (ctx->Light.Enabled && + (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)) + return GL_TRUE; + + if (ctx->Fog.ColorSumEnabled) + return GL_TRUE; + + return GL_FALSE; +} /** * Up to nine instructions per tex unit, plus fog, specular color. @@ -298,7 +310,7 @@ static GLbitfield get_fp_input_mask( GLcontext *ctx ) if (ctx->Light.Enabled) { fp_inputs |= FRAG_BIT_COL0; - if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) + if (texenv_doing_secondary_color(ctx)) fp_inputs |= FRAG_BIT_COL1; } @@ -416,8 +428,8 @@ static void make_state_key( GLcontext *ctx, struct state_key *key ) } } - /* _DD_NEW_SEPARATE_SPECULAR */ - if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) { + /* _NEW_LIGHT | _NEW_FOG */ + if (texenv_doing_secondary_color(ctx)) { key->separate_specular = 1; inputs_referenced |= FRAG_BIT_COL1; } |