st/nine: Fix non inversible matrix check
authorAxel Davy <davyaxel0@gmail.com>
Sat, 10 Mar 2018 17:49:59 +0000 (18:49 +0100)
committerAxel Davy <davyaxel0@gmail.com>
Sun, 18 Mar 2018 21:53:46 +0000 (22:53 +0100)
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@gmail.com>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
CC: "17.3 18.0" <mesa-stable@lists.freedesktop.org>
src/gallium/state_trackers/nine/nine_ff.c

index 6c30839..d7b697c 100644 (file)
@@ -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;
     }