Mesa (mesa_7_5_branch): mesa: disable texture unit error check in _mesa_MatrixMode()

Brian Paul brianp at kemper.freedesktop.org
Wed Jun 10 15:32:19 UTC 2009


Module: Mesa
Branch: mesa_7_5_branch
Commit: 6f50c9865d96a704cf47f59c3c21b4686bddf1f8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6f50c9865d96a704cf47f59c3c21b4686bddf1f8

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Jun 10 08:39:10 2009 -0600

mesa: disable texture unit error check in _mesa_MatrixMode()

See comments for details.

---

 src/mesa/main/matrix.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c
index 39b4967..ebc3cbd 100644
--- a/src/mesa/main/matrix.c
+++ b/src/mesa/main/matrix.c
@@ -160,11 +160,21 @@ _mesa_MatrixMode( GLenum mode )
       ctx->CurrentStack = &ctx->ProjectionMatrixStack;
       break;
    case GL_TEXTURE:
+      /* This error check is disabled because if we're called from
+       * glPopAttrib() when the active texture unit is >= MaxTextureCoordUnits
+       * we'll generate an unexpected error.
+       * From the GL_ARB_vertex_shader spec it sounds like we should instead
+       * do error checking in other places when we actually try to access
+       * texture matrices beyond MaxTextureCoordUnits.
+       */
+#if 0
       if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) {
          _mesa_error(ctx, GL_INVALID_OPERATION, "glMatrixMode(invalid tex unit %d)",
                      ctx->Texture.CurrentUnit);
          return;
       }
+#endif
+      ASSERT(ctx->Texture.CurrentUnit < Elements(ctx->TextureMatrixStack));
       ctx->CurrentStack = &ctx->TextureMatrixStack[ctx->Texture.CurrentUnit];
       break;
    case GL_COLOR:




More information about the mesa-commit mailing list