Skip to content
Snippets Groups Projects
Commit ec791381 authored by Matt Turner's avatar Matt Turner
Browse files

Use INV_SQRT instead of 1/SQRTF


Reviewed-by: default avatarBrian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
parent bd9bf7a4
No related branches found
Tags mesa-18.0.0-rc3
No related merge requests found
......@@ -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;
......
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment