From: Zack Rusin Date: Thu, 12 Nov 2009 02:40:14 +0000 (-0500) Subject: st/xorg: don't use flow control X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=72b4a7d67f90a20d774dddccbc6eed30d01a7f38;p=mesa.git st/xorg: don't use flow control --- 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