summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texenvprogram.c
diff options
context:
space:
mode:
authorAlan Hourihane <[email protected]>2008-11-20 13:44:13 +0000
committerAlan Hourihane <[email protected]>2008-11-20 13:44:13 +0000
commitef2bf418b45c7966e9fe78359058b8d44f570be1 (patch)
treec0bc3be44bae336ca4c9133ffb2529c8d99bbc0f /src/mesa/main/texenvprogram.c
parent4f3dcf3864c3cbd8a6ebc6af38e53d57e4d421d6 (diff)
parentb6bb5e09e0ad1f61f96c65bbc870bd493df12f1a (diff)
Merge commit 'origin/master' into gallium-0.2
Diffstat (limited to 'src/mesa/main/texenvprogram.c')
-rw-r--r--src/mesa/main/texenvprogram.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c
index 237ddaa6838..3cb103f51f8 100644
--- a/src/mesa/main/texenvprogram.c
+++ b/src/mesa/main/texenvprogram.c
@@ -297,10 +297,13 @@ static void make_state_key( GLcontext *ctx, struct state_key *key )
for (i=0;i<MAX_TEXTURE_UNITS;i++) {
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
+ GLenum format;
if (!texUnit->_ReallyEnabled || !texUnit->Enabled)
continue;
+ format = texUnit->_Current->Image[0][texUnit->_Current->BaseLevel]->_BaseFormat;
+
key->unit[i].enabled = 1;
key->enabled_units |= (1<<i);
key->nr_enabled_units = i+1;
@@ -308,7 +311,9 @@ static void make_state_key( GLcontext *ctx, struct state_key *key )
key->unit[i].source_index =
translate_tex_src_bit(texUnit->_ReallyEnabled);
- key->unit[i].shadow = texUnit->_Current->CompareMode == GL_COMPARE_R_TO_TEXTURE;
+ key->unit[i].shadow = ((texUnit->_Current->CompareMode == GL_COMPARE_R_TO_TEXTURE) &&
+ ((format == GL_DEPTH_COMPONENT) ||
+ (format == GL_DEPTH_STENCIL_EXT)));
key->unit[i].NumArgsRGB = texUnit->_CurrentCombine->_NumArgsRGB;
key->unit[i].NumArgsA = texUnit->_CurrentCombine->_NumArgsA;