summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_fog.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2005-09-19 20:12:32 +0000
committerBrian Paul <[email protected]>2005-09-19 20:12:32 +0000
commitb3aefd1cfb6aacd1695c52911dd39da50d893ece (patch)
tree247125551b41cc22dec6f1f03bb1d6709c804bba /src/mesa/swrast/s_fog.c
parenta01cb26a90aaa8f631c94d741617715dff89168c (diff)
additional wrapper updates, bug 4468
Diffstat (limited to 'src/mesa/swrast/s_fog.c')
-rw-r--r--src/mesa/swrast/s_fog.c12
1 files changed, 6 insertions, 6 deletions
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;