From 214347fdb4c30dc8bac5d4b9a823458709bc53ea Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Fri, 31 Aug 2007 16:50:48 +0800 Subject: [PATCH] i965: Calculate the positional light in homogeneous coordinates. fix bug#11009 --- src/mesa/drivers/dri/i965/brw_vs_tnl.c | 5 +++++ src/mesa/tnl/t_vp_build.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_vs_tnl.c b/src/mesa/drivers/dri/i965/brw_vs_tnl.c index b69be350a92..339a3304483 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_tnl.c +++ b/src/mesa/drivers/dri/i965/brw_vs_tnl.c @@ -1003,6 +1003,11 @@ static void build_lighting( struct tnl_program *p ) VPpli = get_temp(p); half = get_temp(p); + + /* In homogeneous object coordinates + */ + emit_op1(p, OPCODE_RCP, dist, 0, swizzle1(Ppli, W)); + emit_op2(p, OPCODE_MUL, Ppli, 0, Ppli, dist); /* Calulate VPpli vector */ diff --git a/src/mesa/tnl/t_vp_build.c b/src/mesa/tnl/t_vp_build.c index ee1a2498b32..336f3c7a2a2 100644 --- a/src/mesa/tnl/t_vp_build.c +++ b/src/mesa/tnl/t_vp_build.c @@ -960,6 +960,11 @@ static void build_lighting( struct tnl_program *p ) VPpli = get_temp(p); half = get_temp(p); + /* In homogeneous object coordinates + */ + emit_op1(p, OPCODE_RCP, dist, 0, swizzle1(Ppli, W)); + emit_op2(p, OPCODE_MUL, Ppli, 0, Ppli, dist); + /* Calulate VPpli vector */ emit_op2(p, OPCODE_SUB, VPpli, 0, Ppli, V); -- 2.30.2