From: Brian Paul Date: Sat, 29 Oct 2005 16:05:18 +0000 (+0000) Subject: fix LIT bug X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=af13891dbdfd7ec46f85238f83eacaf6d1aeb2eb;p=mesa.git fix LIT bug --- 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 ); }