From af13891dbdfd7ec46f85238f83eacaf6d1aeb2eb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 29 Oct 2005 16:05:18 +0000 Subject: [PATCH] fix LIT bug --- src/mesa/swrast/s_nvfragprog.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mesa/swrast/s_nvfragprog.c b/src/mesa/swrast/s_nvfragprog.c index 987163389a1..218abedadf2 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 ); } -- 2.30.2