[Mesa-dev] [PATCH 30/53] st/nine: Remove duplicated code for ps texcoord input declaration
Axel Davy
axel.davy at ens.fr
Wed Jan 7 08:36:40 PST 2015
Reviewed-by: David Heidelberg <david at ixit.cz>
Signed-off-by: Axel Davy <axel.davy at ens.fr>
---
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 8bcf67b..3fefce4 100644
--- a/src/gallium/state_trackers/nine/nine_shader.c
+++ b/src/gallium/state_trackers/nine/nine_shader.c
@@ -2046,8 +2046,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;
@@ -2059,8 +2058,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;
@@ -2159,8 +2157,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]));
@@ -2244,8 +2241,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.1.3
More information about the mesa-dev
mailing list