diff options
author | Matt Turner <[email protected]> | 2015-07-12 23:15:01 -0700 |
---|---|---|
committer | Matt Turner <[email protected]> | 2015-07-29 09:34:52 -0700 |
commit | c92b2a1d7b286de8641512970a87c94809fbbc3f (patch) | |
tree | dfba41a970e59d8ae177856ee99519b7405128ce /src/mesa/tnl/t_vb_light.c | |
parent | 2b47ef715ad33f6c4a4881b10240d792ba9e60b2 (diff) |
tnl: Avoid double promotion.
There are a couple of unrelated changes in t_vb_lighttmp.h that I hope
you'll excuse -- there's a block of code that's duplicated modulo a few
trivial differences that I took the liberty of fixing.
Diffstat (limited to 'src/mesa/tnl/t_vb_light.c')
-rw-r--r-- | src/mesa/tnl/t_vb_light.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c index dbd57fa6bfe..029265a4f83 100644 --- a/src/mesa/tnl/t_vb_light.c +++ b/src/mesa/tnl/t_vb_light.c @@ -137,23 +137,23 @@ validate_shine_table( struct gl_context *ctx, GLuint side, GLfloat shininess ) break; m = s->tab; - m[0] = 0.0; - if (shininess == 0.0) { + m[0] = 0.0F; + if (shininess == 0.0F) { for (j = 1 ; j <= SHINE_TABLE_SIZE ; j++) - m[j] = 1.0; + m[j] = 1.0F; } else { for (j = 1 ; j < SHINE_TABLE_SIZE ; j++) { - GLdouble t, x = j / (GLfloat) (SHINE_TABLE_SIZE - 1); - if (x < 0.005) /* underflow check */ - x = 0.005; - t = pow(x, shininess); - if (t > 1e-20) - m[j] = (GLfloat) t; + GLfloat t, x = j / (GLfloat) (SHINE_TABLE_SIZE - 1); + if (x < 0.005F) /* underflow check */ + x = 0.005F; + t = powf(x, shininess); + if (t > 1e-20F) + m[j] = t; else - m[j] = 0.0; + m[j] = 0.0F; } - m[SHINE_TABLE_SIZE] = 1.0; + m[SHINE_TABLE_SIZE] = 1.0F; } s->shininess = shininess; |