Further clean up RoughApproxPow2 and disable the optimized version --

it's a very poor approximation.
This commit is contained in:
Keith Whitwell
2005-06-09 18:59:41 +00:00
parent 2c6e8e90ec
commit 44367aab2a

View File

@@ -96,16 +96,17 @@ static GLfloat RoughApproxLog2(GLfloat t)
static GLfloat RoughApproxPow2(GLfloat t) static GLfloat RoughApproxPow2(GLfloat t)
{ {
GLfloat q; #if 0
#ifdef USE_IEEE /* This isn't nearly accurate enough - it discards all of t's
GLint ii = (GLint) t; * fractional bits!
ii = (ii << 23) + 0x3f800000; */
SET_FLOAT_BITS(q, ii); fi_type fi;
q = *((GLfloat *) (void *)&ii); fi.i = (GLint) t;
fi.i = (fi.i << 23) + 0x3f800000;
return fi.f;
#else #else
q = (GLfloat) pow(2.0, floor_t0); return (GLfloat) _mesa_pow(2.0, floor_t0);
#endif #endif
return q;
} }
static GLfloat RoughApproxPower(GLfloat x, GLfloat y) static GLfloat RoughApproxPower(GLfloat x, GLfloat y)