aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/attrib.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2012-01-27 16:09:48 -0800
committerIan Romanick <[email protected]>2012-07-06 09:50:05 -0700
commit7a34e98b6143ad0945e3b33862ba894229530cf7 (patch)
treeafb0d282af4a1c3984f9feeb6e7a6db0b0c91048 /src/mesa/main/attrib.c
parent39a0b79c6f1312a5f8e6cd61fba95a81a911e577 (diff)
mesa: Restore depth texture state on glPopAttrib(GL_TEXTURE_BIT).
According to Table 6.17 in the GL 2.1 specification, DEPTH_TEXTURE_MODE, TEXTURE_COMPARE_MODE, and TEXTURE_COMPARE_FUNC need to be restored on glPopAttrib(GL_TEXTURE_BIT). Makes a number of oglconform tests happier. v2: Make restoration conditional on the ARB_shadow and ARB_depth_texture extensions, as suggested by Brian. I'm not sure that any implementations still remain that don't support those, but why not? NOTE: This is a candidate for stable release branches. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]> (cherry picked from commit 608c3d2083be9de1eadac6dad67cd571888ca5d7)
Diffstat (limited to 'src/mesa/main/attrib.c')
-rw-r--r--src/mesa/main/attrib.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index 356b221b15c..ca816026e16 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -799,6 +799,14 @@ pop_texture_group(struct gl_context *ctx, struct texture_state *texstate)
_mesa_TexParameterf(target, GL_TEXTURE_COMPARE_FAIL_VALUE_ARB,
samp->CompareFailValue);
}
+ if (ctx->Extensions.ARB_shadow) {
+ _mesa_TexParameteri(target, GL_TEXTURE_COMPARE_MODE,
+ samp->CompareMode);
+ _mesa_TexParameteri(target, GL_TEXTURE_COMPARE_FUNC,
+ samp->CompareFunc);
+ }
+ if (ctx->Extensions.ARB_depth_texture)
+ _mesa_TexParameteri(target, GL_DEPTH_TEXTURE_MODE, samp->DepthMode);
}
/* remove saved references to the texture objects */