From 79674066b6f98be96cb63a0332ac421858544a20 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 28 Aug 2017 23:28:33 +0200 Subject: [PATCH] st/mesa: fix XPD lowering - don't read dst Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102461 Reviewed-by: Brian Paul --- src/mesa/state_tracker/st_mesa_to_tgsi.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index 916f7fa2e86..fa9fa440efd 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -562,8 +562,10 @@ compile_instruction( ureg_scalar(src[0], TGSI_SWIZZLE_X)); break; - case OPCODE_XPD: - ureg_MUL(ureg, ureg_writemask(dst[0], TGSI_WRITEMASK_XYZ), + case OPCODE_XPD: { + struct ureg_dst tmp = ureg_DECL_temporary(ureg); + + ureg_MUL(ureg, ureg_writemask(tmp, TGSI_WRITEMASK_XYZ), ureg_swizzle(src[0], TGSI_SWIZZLE_Y, TGSI_SWIZZLE_Z, TGSI_SWIZZLE_X, 0), ureg_swizzle(src[1], TGSI_SWIZZLE_Z, TGSI_SWIZZLE_X, @@ -573,8 +575,9 @@ compile_instruction( TGSI_SWIZZLE_Y, 0), ureg_negate(ureg_swizzle(src[1], TGSI_SWIZZLE_Y, TGSI_SWIZZLE_Z, TGSI_SWIZZLE_X, 0)), - ureg_src(dst[0])); + ureg_src(tmp)); break; + } case OPCODE_RSQ: ureg_RSQ( ureg, dst[0], ureg_abs(src[0]) ); -- 2.30.2