diff options
author | Brian Paul <[email protected]> | 2005-09-19 20:12:32 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2005-09-19 20:12:32 +0000 |
commit | b3aefd1cfb6aacd1695c52911dd39da50d893ece (patch) | |
tree | 247125551b41cc22dec6f1f03bb1d6709c804bba /src/mesa/swrast | |
parent | a01cb26a90aaa8f631c94d741617715dff89168c (diff) |
additional wrapper updates, bug 4468
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r-- | src/mesa/swrast/s_aaline.c | 2 | ||||
-rw-r--r-- | src/mesa/swrast/s_fog.c | 12 | ||||
-rw-r--r-- | src/mesa/swrast/s_nvfragprog.c | 2 | ||||
-rw-r--r-- | src/mesa/swrast/s_texfilter.c | 12 |
4 files changed, 14 insertions, 14 deletions
diff --git a/src/mesa/swrast/s_aaline.c b/src/mesa/swrast/s_aaline.c index 39c51a50f71..b8c214f6890 100644 --- a/src/mesa/swrast/s_aaline.c +++ b/src/mesa/swrast/s_aaline.c @@ -210,7 +210,7 @@ compute_lambda(const GLfloat sPlane[4], const GLfloat tPlane[4], if (rho2 == 0.0F) return 0.0; else - return (GLfloat) (log(rho2) * 1.442695 * 0.5);/* 1.442695 = 1/log(2) */ + return (GLfloat) (LOGF(rho2) * 1.442695 * 0.5);/* 1.442695 = 1/log(2) */ } diff --git a/src/mesa/swrast/s_fog.c b/src/mesa/swrast/s_fog.c index 0af9cd8f284..e3d6274b3fe 100644 --- a/src/mesa/swrast/s_fog.c +++ b/src/mesa/swrast/s_fog.c @@ -51,12 +51,12 @@ _swrast_z_to_fogfactor(GLcontext *ctx, GLfloat z) return CLAMP(f, 0.0F, 1.0F); case GL_EXP: d = ctx->Fog.Density; - f = (GLfloat) exp(-d * z); + f = EXPF(-d * z); f = CLAMP(f, 0.0F, 1.0F); return f; case GL_EXP2: d = ctx->Fog.Density; - f = (GLfloat) exp(-(d * d * z * z)); + f = EXPF(-(d * d * z * z)); f = CLAMP(f, 0.0F, 1.0F); return f; default: @@ -130,7 +130,7 @@ _swrast_fog_rgba_span( const GLcontext *ctx, struct sw_span *span ) GLuint i; for (i = 0; i < span->end; i++) { GLfloat f, oneMinusF; - f = (GLfloat) exp(density * FABSF(fogCoord) / w); + f = EXPF(density * FABSF(fogCoord) / w); f = CLAMP(f, 0.0F, 1.0F); oneMinusF = 1.0F - f; rgba[i][RCOMP] = (GLchan) (f * rgba[i][RCOMP] + oneMinusF * rFog); @@ -158,7 +158,7 @@ _swrast_fog_rgba_span( const GLcontext *ctx, struct sw_span *span ) if (tmp < FLT_MIN_10_EXP) tmp = FLT_MIN_10_EXP; #endif - f = (GLfloat) exp(tmp); + f = EXPF(tmp); f = CLAMP(f, 0.0F, 1.0F); oneMinusF = 1.0F - f; rgba[i][RCOMP] = (GLchan) (f * rgba[i][RCOMP] + oneMinusF * rFog); @@ -259,7 +259,7 @@ _swrast_fog_ci_span( const GLcontext *ctx, struct sw_span *span ) GLfloat w = haveW ? span->w : 1.0F; GLuint i; for (i = 0; i < span->end; i++) { - GLfloat f = (GLfloat) exp(density * fogCoord / w); + GLfloat f = EXPF(density * fogCoord / w); f = CLAMP(f, 0.0F, 1.0F); index[i] = (GLuint) ((GLfloat) index[i] + (1.0F - f) * fogIndex); fogCoord += fogStep; @@ -284,7 +284,7 @@ _swrast_fog_ci_span( const GLcontext *ctx, struct sw_span *span ) if (tmp < FLT_MIN_10_EXP) tmp = FLT_MIN_10_EXP; #endif - f = (GLfloat) exp(tmp); + f = EXPF(tmp); f = CLAMP(f, 0.0F, 1.0F); index[i] = (GLuint) ((GLfloat) index[i] + (1.0F - f) * fogIndex); fogCoord += fogStep; diff --git a/src/mesa/swrast/s_nvfragprog.c b/src/mesa/swrast/s_nvfragprog.c index 931bf64f925..1e18120152a 100644 --- a/src/mesa/swrast/s_nvfragprog.c +++ b/src/mesa/swrast/s_nvfragprog.c @@ -821,7 +821,7 @@ execute_program( GLcontext *ctx, result[0] = 1.0F; result[1] = a[0]; /* XXX we could probably just use pow() here */ - result[2] = (a[0] > 0.0F) ? (GLfloat) exp(a[3] * log(a[1])) : 0.0F; + result[2] = (a[0] > 0.0F) ? EXPF(a[3] * LOGF(a[1])) : 0.0F; result[3] = 1.0F; store_vector4( inst, machine, result ); } diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 59673bb978a..0597947f515 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -297,7 +297,7 @@ repeat_remainder(GLint a, GLint b) } \ break; \ case GL_MIRROR_CLAMP_EXT: \ - U = (GLfloat) fabs(S); \ + U = FABSF(S); \ if (U >= 1.0F) \ U = (GLfloat) SIZE; \ else \ @@ -307,7 +307,7 @@ repeat_remainder(GLint a, GLint b) I1 = I0 + 1; \ break; \ case GL_MIRROR_CLAMP_TO_EDGE_EXT: \ - U = (GLfloat) fabs(S); \ + U = FABSF(S); \ if (U >= 1.0F) \ U = (GLfloat) SIZE; \ else \ @@ -324,7 +324,7 @@ repeat_remainder(GLint a, GLint b) { \ const GLfloat min = -1.0F / (2.0F * SIZE); \ const GLfloat max = 1.0F - min; \ - U = (GLfloat) fabs(S); \ + U = FABSF(S); \ if (U <= min) \ U = min * SIZE; \ else if (U >= max) \ @@ -418,7 +418,7 @@ repeat_remainder(GLint a, GLint b) { \ /* s limited to [0,1] */ \ /* i limited to [0,size-1] */ \ - const GLfloat u = (GLfloat) fabs(S); \ + const GLfloat u = FABSF(S); \ if (u <= 0.0F) \ I = 0; \ else if (u >= 1.0F) \ @@ -433,7 +433,7 @@ repeat_remainder(GLint a, GLint b) /* i limited to [0, size-1] */ \ const GLfloat min = 1.0F / (2.0F * SIZE); \ const GLfloat max = 1.0F - min; \ - const GLfloat u = (GLfloat) fabs(S); \ + const GLfloat u = FABSF(S); \ if (u < min) \ I = 0; \ else if (u > max) \ @@ -448,7 +448,7 @@ repeat_remainder(GLint a, GLint b) /* i limited to [0, size-1] */ \ const GLfloat min = -1.0F / (2.0F * SIZE); \ const GLfloat max = 1.0F - min; \ - const GLfloat u = (GLfloat) fabs(S); \ + const GLfloat u = FABSF(S); \ if (u < min) \ I = -1; \ else if (u > max) \ |