diff options
author | Marek Olšák <[email protected]> | 2017-08-19 22:00:02 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-08-22 13:29:47 +0200 |
commit | 3e2ff8fade879cedfdff0e180a6996df1223a823 (patch) | |
tree | c6601d72e5f5ba13264f7355fef41558ed65cbf3 /src/mesa | |
parent | 86e6f7a73bdbced24e10fb80fdcba591e0568120 (diff) |
gallium: remove TGSI opcode DPH
use DP4 or DP3 + ADD.
Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_mesa_to_tgsi.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index f6eb5effc66..5f78026dda0 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -457,8 +457,6 @@ translate_opcode( unsigned op ) return TGSI_OPCODE_DP3; case OPCODE_DP4: return TGSI_OPCODE_DP4; - case OPCODE_DPH: - return TGSI_OPCODE_DPH; case OPCODE_DST: return TGSI_OPCODE_DST; case OPCODE_EX2: @@ -589,6 +587,17 @@ compile_instruction( ureg_ADD(ureg, dst[0], src[0], ureg_negate(src[1])); break; + case OPCODE_DPH: { + struct ureg_dst temp = ureg_DECL_temporary(ureg); + + /* DPH = DP4(src0, src1) where src0.w = 1. */ + ureg_MOV(ureg, ureg_writemask(temp, TGSI_WRITEMASK_XYZ), src[0]); + ureg_MOV(ureg, ureg_writemask(temp, TGSI_WRITEMASK_W), + ureg_imm1f(ureg, 1)); + ureg_DP4(ureg, dst[0], ureg_src(temp), src[1]); + break; + } + default: ureg_insn( ureg, translate_opcode( inst->Opcode ), |