Mesa (mesa_7_4_branch): mesa: only clear matrix MAT_DIRTY_INVERSE flag when we actually compute the inverse

Brian Paul brianp at kemper.freedesktop.org
Tue Apr 7 14:37:39 UTC 2009


Module: Mesa
Branch: mesa_7_4_branch
Commit: ca24095c1e8a9432036d55fab18744af7d167815
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ca24095c1e8a9432036d55fab18744af7d167815

Author: Brian Paul <brianp at vmware.com>
Date:   Tue Apr  7 08:33:43 2009 -0600

mesa: only clear matrix MAT_DIRTY_INVERSE flag when we actually compute the inverse

If _math_matrix_analyse() got called before we allocated the inverse
matrix array we could lose the flag indicating that we needed to compute
the inverse.  This could happen with certain vertex shader cases.

(cherry picked from master, commit ce461ffc5aa2ea6941d6722e8ed473cda8c17833)

---

 src/mesa/math/m_matrix.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c
index 84b4cae..5f300f4 100644
--- a/src/mesa/math/m_matrix.c
+++ b/src/mesa/math/m_matrix.c
@@ -1379,11 +1379,10 @@ _math_matrix_analyse( GLmatrix *mat )
 
    if (mat->inv && (mat->flags & MAT_DIRTY_INVERSE)) {
       matrix_invert( mat );
+      mat->flags &= ~MAT_DIRTY_INVERSE;
    }
 
-   mat->flags &= ~(MAT_DIRTY_FLAGS|
-		   MAT_DIRTY_TYPE|
-		   MAT_DIRTY_INVERSE);
+   mat->flags &= ~(MAT_DIRTY_FLAGS | MAT_DIRTY_TYPE);
 }
 
 /*@}*/




More information about the mesa-commit mailing list