summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2005-10-30 16:52:02 +0000
committerBrian Paul <[email protected]>2005-10-30 16:52:02 +0000
commit094a1ddf2498d598da5abaef6d6ed53ec2dbe6dc (patch)
tree4dff82682c117a4324df71d91d4ab3919e0a07e2 /src/mesa/swrast
parent5d04101d18270eec1692e691b1a4321a0ee3fb10 (diff)
need to use absolute value for RSQ
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/s_nvfragprog.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/swrast/s_nvfragprog.c b/src/mesa/swrast/s_nvfragprog.c
index 218abedadf2..434f3f5c060 100644
--- a/src/mesa/swrast/s_nvfragprog.c
+++ b/src/mesa/swrast/s_nvfragprog.c
@@ -1031,10 +1031,11 @@ execute_program( GLcontext *ctx,
{
GLfloat a[4], result[4];
fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a );
+ a[0] = FABSF(a[0]);
result[0] = result[1] = result[2] = result[3] = INV_SQRTF(a[0]);
store_vector4( inst, machine, result );
#if DEBUG_FRAG
- printf("RSQ %g = 1/sqrt(%g)\n", result[0], a[0]);
+ printf("RSQ %g = 1/sqrt(|%g|)\n", result[0], a[0]);
#endif
}
break;