diff options
Diffstat (limited to 'src/mesa/math')
-rw-r--r-- | src/mesa/math/m_debug_norm.c | 5 | ||||
-rw-r--r-- | src/mesa/math/m_norm_tmp.h | 6 | ||||
-rw-r--r-- | src/mesa/math/m_xform.c | 1 |
3 files changed, 7 insertions, 5 deletions
diff --git a/src/mesa/math/m_debug_norm.c b/src/mesa/math/m_debug_norm.c index 00e72be54e9..197b43cf2ab 100644 --- a/src/mesa/math/m_debug_norm.c +++ b/src/mesa/math/m_debug_norm.c @@ -26,6 +26,7 @@ * Gareth Hughes */ +#include "c99_math.h" #include "main/glheader.h" #include "main/context.h" #include "main/macros.h" @@ -165,7 +166,7 @@ static void ref_norm_transform_normalize( const GLmatrix *mat, /* Hmmm, don't know how we could test the precalculated * length case... */ - scale = INV_SQRTF( len ); + scale = 1.0f / sqrtf(len); SCALE_SCALAR_3V( out[i], scale, t ); } else { out[i][0] = out[i][1] = out[i][2] = 0; @@ -241,7 +242,7 @@ static int test_norm_function( normal_func func, int mtype, long *cycles ) ASSIGN_3V( d2[i], 0.0, 0.0, 0.0 ); for ( j = 0 ; j < 3 ; j++ ) s[i][j] = rnd(); - length[i] = INV_SQRTF( LEN_SQUARED_3FV( s[i] ) ); + length[i] = 1.0f / sqrtf( LEN_SQUARED_3FV( s[i] ) ); } source->data = (GLfloat(*)[4]) s; diff --git a/src/mesa/math/m_norm_tmp.h b/src/mesa/math/m_norm_tmp.h index 339c03ff82c..c8fab0ed375 100644 --- a/src/mesa/math/m_norm_tmp.h +++ b/src/mesa/math/m_norm_tmp.h @@ -68,7 +68,7 @@ TAG(transform_normalize_normals)( const GLmatrix *mat, { GLdouble len = tx*tx + ty*ty + tz*tz; if (len > 1e-20) { - GLfloat scale = INV_SQRTF(len); + GLfloat scale = 1.0f / sqrtf(len); out[i][0] = tx * scale; out[i][1] = ty * scale; out[i][2] = tz * scale; @@ -135,7 +135,7 @@ TAG(transform_normalize_normals_no_rot)( const GLmatrix *mat, { GLdouble len = tx*tx + ty*ty + tz*tz; if (len > 1e-20) { - GLfloat scale = INV_SQRTF(len); + GLfloat scale = 1.0f / sqrtf(len); out[i][0] = tx * scale; out[i][1] = ty * scale; out[i][2] = tz * scale; @@ -322,7 +322,7 @@ TAG(normalize_normals)( const GLmatrix *mat, const GLfloat x = from[0], y = from[1], z = from[2]; GLdouble len = x * x + y * y + z * z; if (len > 1e-50) { - len = INV_SQRTF(len); + len = 1.0f / sqrtf(len); out[i][0] = (GLfloat)(x * len); out[i][1] = (GLfloat)(y * len); out[i][2] = (GLfloat)(z * len); diff --git a/src/mesa/math/m_xform.c b/src/mesa/math/m_xform.c index 14d1c645379..718ad499363 100644 --- a/src/mesa/math/m_xform.c +++ b/src/mesa/math/m_xform.c @@ -33,6 +33,7 @@ * 3. Transformation of a point p by a matrix M is: p' = M * p */ +#include "c99_math.h" #include "main/glheader.h" #include "main/macros.h" |