st/nine: Implement TEXDP3
authorAxel Davy <axel.davy@ens.fr>
Sun, 28 Dec 2014 13:42:33 +0000 (14:42 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 22 Jan 2015 22:16:23 +0000 (22:16 +0000)
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
src/gallium/state_trackers/nine/nine_shader.c

index 027f5ba036dfee1185af337e8ee275339bc871e0..0585362619d0dd677749c62b81974e4f8a7e1710 100644 (file)
@@ -2252,7 +2252,17 @@ DECL_SPECIAL(TEXM3x2DEPTH)
 
 DECL_SPECIAL(TEXDP3)
 {
-    STUB(D3DERR_INVALIDCALL);
+    struct ureg_program *ureg = tx->ureg;
+    struct ureg_dst dst = tx_dst_param(tx, &tx->insn.dst[0]);
+    const int m = tx->insn.dst[0].idx;
+    const int n = tx->insn.src[0].idx;
+    assert(m >= 0 && m > n);
+
+    tx_texcoord_alloc(tx, m);
+
+    ureg_DP3(ureg, dst, tx->regs.vT[m], ureg_src(tx->regs.tS[n]));
+
+    return D3D_OK;
 }
 
 DECL_SPECIAL(TEXM3x3)