summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2012-07-20 10:03:10 -0700
committerMatt Turner <mattst88@gmail.com>2012-07-21 08:23:38 -0700
commitec79138138c3c88afb2052823b1e3f5271493085 (patch)
tree267c55fc8713925e09cbe4970a4f0fa55317639b /src
parentbd9bf7a42473dfbdae4b61dd2556eba9529e9dd0 (diff)
downloadexternal_mesa3d-ec79138138c3c88afb2052823b1e3f5271493085.zip
external_mesa3d-ec79138138c3c88afb2052823b1e3f5271493085.tar.gz
external_mesa3d-ec79138138c3c88afb2052823b1e3f5271493085.tar.bz2
Use INV_SQRT instead of 1/SQRTF
Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/math/m_debug_norm.c4
-rw-r--r--src/mesa/tnl/t_vb_points.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/math/m_debug_norm.c b/src/mesa/math/m_debug_norm.c
index 02eb1f9..dc768f3 100644
--- a/src/mesa/math/m_debug_norm.c
+++ b/src/mesa/math/m_debug_norm.c
@@ -165,7 +165,7 @@ static void ref_norm_transform_normalize( const GLmatrix *mat,
/* Hmmm, don't know how we could test the precalculated
* length case...
*/
- scale = 1.0 / SQRTF( len );
+ scale = INV_SQRTF( len );
SCALE_SCALAR_3V( out[i], scale, t );
} else {
out[i][0] = out[i][1] = out[i][2] = 0;
@@ -241,7 +241,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] = 1 / SQRTF( LEN_SQUARED_3FV( s[i] ) );
+ length[i] = INV_SQRTF( LEN_SQUARED_3FV( s[i] ) );
}
source->data = (GLfloat(*)[4]) s;
diff --git a/src/mesa/tnl/t_vb_points.c b/src/mesa/tnl/t_vb_points.c
index 9edbbc7..0e33b69 100644
--- a/src/mesa/tnl/t_vb_points.c
+++ b/src/mesa/tnl/t_vb_points.c
@@ -64,7 +64,7 @@ run_point_stage(struct gl_context *ctx, struct tnl_pipeline_stage *stage)
for (i = 0; i < VB->Count; i++) {
const GLfloat dist = FABSF(*eyeCoord);
const GLfloat q = p0 + dist * (p1 + dist * p2);
- const GLfloat atten = (q != 0.0F) ? SQRTF(1.0F / q) : 1.0F;
+ const GLfloat atten = (q != 0.0F) ? INV_SQRTF(q) : 1.0F;
size[i][0] = pointSize * atten; /* clamping done in rasterization */
eyeCoord += eyeCoordStride;
}