[Mesa-dev] [PATCH] mesa: Restore depth texture state on glPopAttrib(GL_TEXTURE_BIT).

Kenneth Graunke kenneth at whitecape.org
Fri Jan 27 16:09:48 PST 2012


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 oglconform's shad-compiler advanced.TestShadow2D_VertShader test
a bit less grumbly.

NOTE: This is a candidate for release branches.
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/mesa/main/attrib.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index 01e7945..07884c1 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -796,6 +796,9 @@ pop_texture_group(struct gl_context *ctx, struct texture_state *texstate)
             _mesa_TexParameterf(target, GL_TEXTURE_COMPARE_FAIL_VALUE_ARB,
                                 samp->CompareFailValue);
          }
+         _mesa_TexParameteri(target, GL_DEPTH_TEXTURE_MODE, samp->DepthMode);
+         _mesa_TexParameteri(target, GL_TEXTURE_COMPARE_MODE, samp->CompareMode);
+         _mesa_TexParameteri(target, GL_TEXTURE_COMPARE_FUNC, samp->CompareFunc);
       }
 
       /* remove saved references to the texture objects */
-- 
1.7.7.6



More information about the mesa-dev mailing list