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

Brian Paul brianp at kemper.freedesktop.org
Fri Apr 3 21:43:59 UTC 2009


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

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Apr  3 12:49:03 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.

---

 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 58cae88..da6956e 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