From e24afc808f7f00941a01fcedeb76df16c062170f Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 8 Nov 2008 10:29:03 -0700 Subject: mesa: use NRM3 in emit_normalize_vec3() when drivers are ready --- src/mesa/main/ffvertex_prog.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesa/main/ffvertex_prog.c') diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c index 5155c01e41..0d1346420c 100644 --- a/src/mesa/main/ffvertex_prog.c +++ b/src/mesa/main/ffvertex_prog.c @@ -726,11 +726,16 @@ static void emit_normalize_vec3( struct tnl_program *p, struct ureg dest, struct ureg src ) { +#if 0 + /* XXX use this when drivers are ready for NRM3 */ + emit_op1(p, OPCODE_NRM3, dest, WRITEMASK_XYZ, src); +#else struct ureg tmp = get_temp(p); emit_op2(p, OPCODE_DP3, tmp, WRITEMASK_X, src, src); emit_op1(p, OPCODE_RSQ, tmp, WRITEMASK_X, tmp); emit_op2(p, OPCODE_MUL, dest, 0, src, swizzle1(tmp, X)); release_temp(p, tmp); +#endif } static void emit_passthrough( struct tnl_program *p, -- cgit v1.2.3 From 8412b06b67d0f9adae18157f550a8cc3da5ae22b Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Tue, 11 Nov 2008 13:36:32 +0800 Subject: mesa: restore the negate flag of dots in build_lighting. Dots is re-used if more than one light is enabled. Previously the negate flag of dots may affect next light. --- src/mesa/main/ffvertex_prog.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/mesa/main/ffvertex_prog.c') diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c index 0d1346420c..ebc02940de 100644 --- a/src/mesa/main/ffvertex_prog.c +++ b/src/mesa/main/ffvertex_prog.c @@ -1311,6 +1311,9 @@ static void build_lighting( struct tnl_program *p ) emit_op3(p, OPCODE_MAD, res0, mask0, swizzle1(lit,Y), diffuse, _bfc0); emit_op3(p, OPCODE_MAD, res1, mask1, swizzle1(lit,Z), specular, _bfc1); + /* restore negate flag for next lighting */ + dots = negate(dots); + release_temp(p, ambient); release_temp(p, diffuse); release_temp(p, specular); -- cgit v1.2.3