summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2009-10-01 13:33:20 -0600
committerBrian Paul <[email protected]>2009-10-01 13:33:20 -0600
commit18883cdf2334511005973155fc517eb678dc0043 (patch)
treec4621af747a5073bbfa4abfe69f5752ed098adb2
parent521e4b9b7e3c79e7362f7cbd594a2e8cf74cdfe4 (diff)
mesa: Return -FLT_MAX instead of 0 for LG2(0).
lim x->0 log(x) = -inf so -FLT_MAX is a better approximation than 0 for LG2(0).
-rw-r--r--src/mesa/shader/prog_execute.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c
index 69b81e724a2..192d39aed1e 100644
--- a/src/mesa/shader/prog_execute.c
+++ b/src/mesa/shader/prog_execute.c
@@ -939,7 +939,7 @@ _mesa_execute_program(GLcontext * ctx,
/* The fast LOG2 macro doesn't meet the precision requirements.
*/
if (a[0] == 0.0F) {
- val = 0.0F;
+ val = -FLT_MAX;
}
else {
val = log(a[0]) * 1.442695F;