summaryrefslogtreecommitdiffstats
path: root/src/mesa/math
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2012-07-24 11:11:45 -0600
committerBrian Paul <brianp@vmware.com>2012-07-26 13:59:43 -0600
commit50db8129152f3d5ea8db13d55f82673d53bf1b8f (patch)
tree308c3a6c93f37ea68d499475f4b87dc0806279e9 /src/mesa/math
parent148c8e639da7ee10fc9e002e3c6d60e17d218b21 (diff)
downloadexternal_mesa3d-50db8129152f3d5ea8db13d55f82673d53bf1b8f.zip
external_mesa3d-50db8129152f3d5ea8db13d55f82673d53bf1b8f.tar.gz
external_mesa3d-50db8129152f3d5ea8db13d55f82673d53bf1b8f.tar.bz2
mesa: loosen small matrix determinant check
When computing a matrix inverse, if the determinant is too small we could hit a divide by zero. There's a check to prevent this (we basically give up on computing the inverse and return the identity matrix.) This patch loosens this test to fix a lighting bug reported by Lars Henning Wendt. v2: use abs(det) to handle negative values NOTE: This is a candidate for the 8.0 branch. Tested-by: Lars Henning Wendt <lars.henning.wendt@gris.tu-darmstadt.de>
Diffstat (limited to 'src/mesa/math')
-rw-r--r--src/mesa/math/m_matrix.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c
index 02aedba..ffbdcdb 100644
--- a/src/mesa/math/m_matrix.c
+++ b/src/mesa/math/m_matrix.c
@@ -513,7 +513,7 @@ static GLboolean invert_matrix_3d_general( GLmatrix *mat )
det = pos + neg;
- if (det*det < 1e-25)
+ if (FABSF(det) < 1e-25)
return GL_FALSE;
det = 1.0F / det;