summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/relnotes-7.0.html1
-rw-r--r--src/mesa/shader/prog_statevars.c16
2 files changed, 9 insertions, 8 deletions
diff --git a/docs/relnotes-7.0.html b/docs/relnotes-7.0.html
index 0430c88a326..ba1d67c41ec 100644
--- a/docs/relnotes-7.0.html
+++ b/docs/relnotes-7.0.html
@@ -38,6 +38,7 @@ TBD
<li>GLSL dFdx() and dFdy() work for fragment program inputs now (texcoords)
<li>Specifying an invalid texture unit as a sampler could lead to a crash
<li>The GLX protocol request for glXDestroyPBuffer() was incorrect (bug 10983)
+<li>ARB vp state.light[n].half value was incorrect (bug 10987)
</ul>
diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c
index 953fbb9b9f7..975a617ac89 100644
--- a/src/mesa/shader/prog_statevars.c
+++ b/src/mesa/shader/prog_statevars.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.3
+ * Version: 7.0
*
* Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
*
@@ -121,17 +121,17 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[],
return;
case STATE_HALF_VECTOR:
{
- GLfloat eye_z[] = {0, 0, 1};
-
+ static const GLfloat eye_z[] = {0, 0, 1};
+ GLfloat p[3];
/* Compute infinite half angle vector:
- * half-vector = light_position + (0, 0, 1)
- * and then normalize. w = 0
- *
+ * halfVector = normalize(normalize(lightPos) + (0, 0, 1))
* light.EyePosition.w should be 0 for infinite lights.
*/
- ADD_3V(value, eye_z, ctx->Light.Light[ln].EyePosition);
+ COPY_3V(p, ctx->Light.Light[ln].EyePosition);
+ NORMALIZE_3FV(p);
+ ADD_3V(value, p, eye_z);
NORMALIZE_3FV(value);
- value[3] = 0;
+ value[3] = 1.0;
}
return;
case STATE_POSITION_NORMALIZED: