summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/ffvertex_prog.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-11-11 14:42:41 -0700
committerBrian Paul <[email protected]>2008-11-11 14:42:41 -0700
commit19e4222f937c9bb95d3a899dd788afb930eecaa4 (patch)
tree5bb25227f53ad93fbdb9dc889ded690dc40ad1d9 /src/mesa/main/ffvertex_prog.c
parent7f3d45758ccbbcff6428d57d26794960e3e9532c (diff)
parent90246d3ea54f54d60593dce1b89f0226058a3c56 (diff)
Merge commit 'origin/master' into gallium-0.2
Conflicts: src/mesa/shader/prog_execute.c src/mesa/shader/slang/library/slang_vertex_builtin_gc.h
Diffstat (limited to 'src/mesa/main/ffvertex_prog.c')
-rw-r--r--src/mesa/main/ffvertex_prog.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c
index 64a4788aa4b..ec0a5e3896d 100644
--- a/src/mesa/main/ffvertex_prog.c
+++ b/src/mesa/main/ffvertex_prog.c
@@ -736,11 +736,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,
@@ -1316,6 +1321,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);