diff options
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/imports.h | 9 | ||||
-rw-r--r-- | src/mesa/main/light.c | 4 | ||||
-rw-r--r-- | src/mesa/main/macros.h | 2 |
3 files changed, 3 insertions, 12 deletions
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index da373b04430..df6a3fe994a 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -119,15 +119,6 @@ static inline int isblank(int ch) { return ch == ' ' || ch == '\t'; } #endif -/** single-precision inverse square root */ -static inline float -INV_SQRTF(float x) -{ - /* XXX we could try Quake's fast inverse square root function here */ - return 1.0F / sqrtf(x); -} - - /*** *** LOG2: Log base 2 of float ***/ diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index 9db0bff49a7..c4d3a532ef5 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -1026,9 +1026,9 @@ update_modelview_scale( struct gl_context *ctx ) GLfloat f = m[2] * m[2] + m[6] * m[6] + m[10] * m[10]; if (f < 1e-12) f = 1.0; if (ctx->_NeedEyeCoords) - ctx->_ModelViewInvScale = (GLfloat) INV_SQRTF(f); + ctx->_ModelViewInvScale = 1.0f / sqrtf(f); else - ctx->_ModelViewInvScale = (GLfloat) sqrtf(f); + ctx->_ModelViewInvScale = sqrtf(f); } } diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h index 11e3b2a62d4..470d3966e82 100644 --- a/src/mesa/main/macros.h +++ b/src/mesa/main/macros.h @@ -775,7 +775,7 @@ NORMALIZE_3FV(GLfloat v[3]) { GLfloat len = (GLfloat) LEN_SQUARED_3FV(v); if (len) { - len = INV_SQRTF(len); + len = 1.0f / sqrtf(len); v[0] *= len; v[1] *= len; v[2] *= len; |