summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-12-19 16:56:56 -0700
committerBrian Paul <[email protected]>2008-12-19 16:56:56 -0700
commit58a82ee57f1e1e67387dd860ac253223db250789 (patch)
tree031ee528fc49bec03d767c8c697f40d15a9ed616 /src/mesa/shader
parent9c8db8685432fedd068157795422764ce96b89a0 (diff)
parentf83f5ec8f5f1159cfd0ec2596ceab725c073266e (diff)
Merge commit 'origin/master' into gallium-0.2
Diffstat (limited to 'src/mesa/shader')
-rw-r--r--src/mesa/shader/prog_execute.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c
index 8163ae6a6f5..a93733c0852 100644
--- a/src/mesa/shader/prog_execute.c
+++ b/src/mesa/shader/prog_execute.c
@@ -963,7 +963,10 @@ _mesa_execute_program(GLcontext * ctx,
{
GLfloat a[4], result[4];
fetch_vector1(&inst->SrcReg[0], machine, a);
- result[0] = result[1] = result[2] = result[3] = LOG2(a[0]);
+ /* The fast LOG2 macro doesn't meet the precision requirements.
+ */
+ result[0] = result[1] = result[2] = result[3] =
+ (log(a[0]) * 1.442695F);
store_vector4(inst, machine, result);
}
break;
@@ -1022,7 +1025,11 @@ _mesa_execute_program(GLcontext * ctx,
GLfloat mantissa = FREXPF(t[0], &exponent);
q[0] = (GLfloat) (exponent - 1);
q[1] = (GLfloat) (2.0 * mantissa); /* map [.5, 1) -> [1, 2) */
- q[2] = (GLfloat) (q[0] + LOG2(q[1]));
+
+ /* The fast LOG2 macro doesn't meet the precision
+ * requirements.
+ */
+ q[2] = (log(t[0]) * 1.442695F);
}
}
else {