From 72b4a7d67f90a20d774dddccbc6eed30d01a7f38 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Wed, 11 Nov 2009 21:40:14 -0500 Subject: st/xorg: don't use flow control --- src/gallium/state_trackers/xorg/xorg_exa_tgsi.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/gallium/state_trackers/xorg/xorg_exa_tgsi.c b/src/gallium/state_trackers/xorg/xorg_exa_tgsi.c index 5880de4154b..da4f8909f61 100644 --- a/src/gallium/state_trackers/xorg/xorg_exa_tgsi.c +++ b/src/gallium/state_trackers/xorg/xorg_exa_tgsi.c @@ -365,29 +365,23 @@ xrender_tex(struct ureg_program *ureg, struct ureg_dst tmp0 = ureg_DECL_temporary(ureg); struct ureg_dst tmp1 = ureg_DECL_temporary(ureg); struct ureg_src const0 = ureg_DECL_constant(ureg, 0); - unsigned label; - ureg_SLT(ureg, tmp1, ureg_swizzle(coords, + ureg_SGT(ureg, tmp1, ureg_swizzle(coords, TGSI_SWIZZLE_X, TGSI_SWIZZLE_Y, TGSI_SWIZZLE_X, TGSI_SWIZZLE_Y), ureg_scalar(const0, TGSI_SWIZZLE_X)); - ureg_SGT(ureg, tmp0, ureg_swizzle(coords, + ureg_SLT(ureg, tmp0, ureg_swizzle(coords, TGSI_SWIZZLE_X, TGSI_SWIZZLE_Y, TGSI_SWIZZLE_X, TGSI_SWIZZLE_Y), ureg_scalar(const0, TGSI_SWIZZLE_W)); - ureg_MAX(ureg, tmp0, ureg_src(tmp0), ureg_src(tmp1)); - ureg_MAX(ureg, tmp0, ureg_scalar(ureg_src(tmp0), TGSI_SWIZZLE_X), + ureg_MIN(ureg, tmp0, ureg_src(tmp0), ureg_src(tmp1)); + ureg_MIN(ureg, tmp0, ureg_scalar(ureg_src(tmp0), TGSI_SWIZZLE_X), ureg_scalar(ureg_src(tmp0), TGSI_SWIZZLE_Y)); - label = ureg_get_instruction_number(ureg) + 2; - ureg_IF(ureg, ureg_src(tmp0), &label); - ureg_MOV(ureg, dst, ureg_scalar(const0, TGSI_SWIZZLE_X)); - label += 2; - ureg_ELSE(ureg, &label); - ureg_TEX(ureg, dst, TGSI_TEXTURE_2D, coords, sampler); - ureg_ENDIF(ureg); + ureg_TEX(ureg, tmp1, TGSI_TEXTURE_2D, coords, sampler); + ureg_MUL(ureg, dst, ureg_src(tmp1), ureg_src(tmp0)); ureg_release_temporary(ureg, tmp0); ureg_release_temporary(ureg, tmp1); } else -- cgit v1.2.3