i965: Add support for DP2 in the VS.
authorEric Anholt <eric@anholt.net>
Tue, 17 Aug 2010 20:59:08 +0000 (13:59 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 17 Aug 2010 20:59:08 +0000 (13:59 -0700)
Fixes glsl-vs-dot-vec2.

src/mesa/drivers/dri/i965/brw_vs_emit.c

index fab6b4f3d5ac4aa85053396388de82e539b1906d..7b946eb0d8e618d480fe1abf6cce1a017e3aecbb 100644 (file)
@@ -47,6 +47,7 @@ brw_vs_arg_can_be_immediate(enum prog_opcode opcode, int arg)
       [OPCODE_MOV] = 1,
       [OPCODE_ADD] = 2,
       [OPCODE_CMP] = 3,
+      [OPCODE_DP2] = 2,
       [OPCODE_DP3] = 2,
       [OPCODE_DP4] = 2,
       [OPCODE_DPH] = 2,
@@ -1654,6 +1655,9 @@ void brw_vs_emit(struct brw_vs_compile *c )
       case OPCODE_COS:
         emit_math1(c, BRW_MATH_FUNCTION_COS, dst, args[0], BRW_MATH_PRECISION_FULL);
         break;
+      case OPCODE_DP2:
+        brw_DP2(p, dst, args[0], args[1]);
+        break;
       case OPCODE_DP3:
         brw_DP3(p, dst, args[0], args[1]);
         break;