summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2005-10-29 16:05:18 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2005-10-29 16:05:18 +0000
commitaf13891dbdfd7ec46f85238f83eacaf6d1aeb2eb (patch)
tree21348326eaf738d1ac8cb603a67fe1d13e191140 /src/mesa
parent4174f79b1916746c826352875b27f897484885e7 (diff)
fix LIT bug
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/swrast/s_nvfragprog.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mesa/swrast/s_nvfragprog.c b/src/mesa/swrast/s_nvfragprog.c
index 987163389a..218abedadf 100644
--- a/src/mesa/swrast/s_nvfragprog.c
+++ b/src/mesa/swrast/s_nvfragprog.c
@@ -821,7 +821,15 @@ 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) ? EXPF(a[3] * LOGF(a[1])) : 0.0F;
+ if (a[0] > 0.0F) {
+ if (a[1] == 0.0 && a[3] == 0.0)
+ result[2] = 1.0;
+ else
+ result[2] = EXPF(a[3] * LOGF(a[1]));
+ }
+ else {
+ result[2] = 0.0;
+ }
result[3] = 1.0F;
store_vector4( inst, machine, result );
}