From 8bbc5e27810a005b8e0c89ab1016a5ba6cff73d2 Mon Sep 17 00:00:00 2001 From: Axel Davy Date: Wed, 3 Dec 2014 15:58:34 +0100 Subject: [PATCH] st/nine: Remove duplicated code for ps texcoord input declaration Reviewed-by: Ilia Mirkin Reviewed-by: David Heidelberg Signed-off-by: Axel Davy --- src/gallium/state_trackers/nine/nine_shader.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c index 9d44598f173..bd695039e33 100644 --- a/src/gallium/state_trackers/nine/nine_shader.c +++ b/src/gallium/state_trackers/nine/nine_shader.c @@ -2057,8 +2057,7 @@ DECL_SPECIAL(TEXCOORD) const unsigned s = tx->insn.dst[0].idx; struct ureg_dst dst = tx_dst_param(tx, &tx->insn.dst[0]); - if (ureg_src_is_undef(tx->regs.vT[s])) - tx->regs.vT[s] = ureg_DECL_fs_input(ureg, tx->texcoord_sn, s, TGSI_INTERPOLATE_PERSPECTIVE); + tx_texcoord_alloc(tx, s); ureg_MOV(ureg, dst, tx->regs.vT[s]); /* XXX is this sufficient ? */ return D3D_OK; @@ -2070,8 +2069,7 @@ DECL_SPECIAL(TEXCOORD_ps14) const unsigned s = tx->insn.src[0].idx; struct ureg_dst dst = tx_dst_param(tx, &tx->insn.dst[0]); - if (ureg_src_is_undef(tx->regs.vT[s])) - tx->regs.vT[s] = ureg_DECL_fs_input(ureg, tx->texcoord_sn, s, TGSI_INTERPOLATE_PERSPECTIVE); + tx_texcoord_alloc(tx, s); ureg_MOV(ureg, dst, tx->regs.vT[s]); /* XXX is this sufficient ? */ return D3D_OK; @@ -2170,8 +2168,7 @@ DECL_SPECIAL(TEXM3x3) assert(m >= 0 && m > n); for (s = m; s <= (m + 2); ++s) { - if (ureg_src_is_undef(tx->regs.vT[s])) - tx->regs.vT[s] = ureg_DECL_fs_input(ureg, tx->texcoord_sn, s, TGSI_INTERPOLATE_PERSPECTIVE); + tx_texcoord_alloc(tx, s); src[s] = tx->regs.vT[s]; } ureg_DP3(ureg, ureg_writemask(dst, TGSI_WRITEMASK_X), src[0], ureg_src(tx->regs.tS[n])); @@ -2255,8 +2252,7 @@ DECL_SPECIAL(TEX) struct ureg_dst dst = tx_dst_param(tx, &tx->insn.dst[0]); struct ureg_src src[2]; - if (ureg_src_is_undef(tx->regs.vT[s])) - tx->regs.vT[s] = ureg_DECL_fs_input(ureg, tx->texcoord_sn, s, TGSI_INTERPOLATE_PERSPECTIVE); + tx_texcoord_alloc(tx, s); src[0] = tx->regs.vT[s]; src[1] = ureg_DECL_sampler(ureg, s); -- 2.30.2