summaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl/t_vp_build.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/tnl/t_vp_build.c')
-rw-r--r--src/mesa/tnl/t_vp_build.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mesa/tnl/t_vp_build.c b/src/mesa/tnl/t_vp_build.c
index 81266f3c8b4..2a97a1c8c76 100644
--- a/src/mesa/tnl/t_vp_build.c
+++ b/src/mesa/tnl/t_vp_build.c
@@ -939,7 +939,14 @@ static void build_lighting( struct tnl_program *p )
*/
VPpli = register_param3(p, STATE_LIGHT, i,
STATE_POSITION_NORMALIZED);
- half = register_param3(p, STATE_LIGHT, i, STATE_HALF);
+ if (p->state->light_local_viewer) {
+ struct ureg eye_hat = get_eye_position_normalized(p);
+ half = get_temp(p);
+ emit_op2(p, OPCODE_SUB, half, 0, VPpli, eye_hat);
+ emit_normalize_vec3(p, half, half);
+ } else {
+ half = register_param3(p, STATE_LIGHT, i, STATE_HALF);
+ }
}
else {
struct ureg Ppli = register_param3(p, STATE_LIGHT, i,