summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvfx/nvfx_vertprog.c
diff options
context:
space:
mode:
authorLuca Barbieri <[email protected]>2010-08-21 19:43:46 +0200
committerLuca Barbieri <[email protected]>2010-08-21 20:42:15 +0200
commit32d2525d645e4a06a116a1c0433bda0dd3bc245f (patch)
tree8d3d751179e4853cde0b5656063e1c27c5a7408e /src/gallium/drivers/nvfx/nvfx_vertprog.c
parent4aec8aa2e33b0bf9d5e8c292d604fe988e439bca (diff)
nvfx: implement DP2 in vp and fp
Diffstat (limited to 'src/gallium/drivers/nvfx/nvfx_vertprog.c')
-rw-r--r--src/gallium/drivers/nvfx/nvfx_vertprog.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/nvfx/nvfx_vertprog.c b/src/gallium/drivers/nvfx/nvfx_vertprog.c
index d68224ce7a2..6b19d86a180 100644
--- a/src/gallium/drivers/nvfx/nvfx_vertprog.c
+++ b/src/gallium/drivers/nvfx/nvfx_vertprog.c
@@ -514,6 +514,11 @@ nvfx_vertprog_parse_instruction(struct nvfx_context* nvfx, struct nvfx_vpc *vpc,
case TGSI_OPCODE_COS:
nvfx_vp_emit(vpc, arith(SCA, COS, dst, mask, none, none, src[0]));
break;
+ case TGSI_OPCODE_DP2:
+ tmp = nvfx_src(temp(vpc));
+ nvfx_vp_emit(vpc, arith(VEC, MUL, tmp.reg, NVFX_VP_MASK_X | NVFX_VP_MASK_Y, src[0], src[1], none));
+ nvfx_vp_emit(vpc, arith(VEC, ADD, dst, mask, swz(tmp, X, X, X, X), swz(tmp, Y, Y, Y, Y), none));
+ break;
case TGSI_OPCODE_DP3:
nvfx_vp_emit(vpc, arith(VEC, DP3, dst, mask, src[0], src[1], none));
break;