i965: Calculate the positional light in homogeneous coordinates.
authorXiang, Haihao <haihao.xiang@intel.com>
Fri, 31 Aug 2007 08:50:48 +0000 (16:50 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Fri, 31 Aug 2007 08:50:48 +0000 (16:50 +0800)
fix bug#11009

src/mesa/drivers/dri/i965/brw_vs_tnl.c
src/mesa/tnl/t_vp_build.c

index b69be350a92b7bc34c66fd27ddbe783257517bbe..339a3304483a33e43cee3bc349fc15dd87e620bc 100644 (file)
@@ -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
             */
index ee1a2498b320e400057040d19aebb79e7724e16a..336f3c7a2a2adcf0c08a9f2a4ed21dc6414b4b5e 100644 (file)
@@ -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);