[Mesa-stable] [PATCH 4/4] st/nine: Fix non inversible matrix check

Axel Davy davyaxel0 at gmail.com
Tue Mar 13 22:09:42 UTC 2018


There was a missing absolute value when
checking if the determinant was big enough.

Fixes: https://github.com/iXit/Mesa-3D/issues/292

Signed-off-by: Axel Davy <davyaxel0 at gmail.com>

CC: "17.3 18.0" <mesa-stable at lists.freedesktop.org>
---
 src/gallium/state_trackers/nine/nine_ff.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/nine/nine_ff.c b/src/gallium/state_trackers/nine/nine_ff.c
index 6c30839b29..d7b697caee 100644
--- a/src/gallium/state_trackers/nine/nine_ff.c
+++ b/src/gallium/state_trackers/nine/nine_ff.c
@@ -2474,7 +2474,7 @@ nine_d3d_matrix_inverse(D3DMATRIX *D, const D3DMATRIX *M)
         M->m[2][0] * D->m[0][2] +
         M->m[3][0] * D->m[0][3];
 
-    if (det < 1e-30) {/* non inversible */
+    if (fabsf(det) < 1e-30) {/* non inversible */
         *D = *M; /* wine tests */
         return;
     }
-- 
2.16.2



More information about the mesa-stable mailing list