r600g: add DPH support.
authorDave Airlie <airlied@redhat.com>
Tue, 24 Aug 2010 00:29:33 +0000 (10:29 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 27 Aug 2010 05:29:03 +0000 (15:29 +1000)
src/gallium/drivers/r600/r600_shader.c

index f0b7df5a6f3ca8fd613e98fa27cbc6c2c8b56679..6195bd53328f780ce5059732be43c009b4eb55cc 100644 (file)
@@ -1265,6 +1265,13 @@ static int tgsi_dp(struct r600_shader_ctx *ctx)
                                alu.src[0].chan = alu.src[1].chan = 0;
                        }
                        break;
+               case TGSI_OPCODE_DPH:
+                       if (i == 3) {
+                               alu.src[0].sel = V_SQ_ALU_SRC_1;
+                               alu.src[0].chan = 0;
+                               alu.src[0].neg = 0;
+                       }
+                       break;
                default:
                        break;
                }
@@ -1660,7 +1667,7 @@ static struct r600_shader_tgsi_instruction r600_shader_tgsi_instruction[] = {
        {32,                    0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, tgsi_unsupported},
        {TGSI_OPCODE_ABS,       0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV, tgsi_op2},
        {TGSI_OPCODE_RCC,       0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, tgsi_unsupported},
-       {TGSI_OPCODE_DPH,       0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP, tgsi_unsupported},
+       {TGSI_OPCODE_DPH,       0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_DOT4, tgsi_dp},
        {TGSI_OPCODE_COS,       0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_COS, tgsi_trig},
        {TGSI_OPCODE_DDX,       0, SQ_TEX_INST_GET_GRADIENTS_H, tgsi_tex},
        {TGSI_OPCODE_DDY,       0, SQ_TEX_INST_GET_GRADIENTS_V, tgsi_tex},