st/mesa: fix XPD lowering - don't read dst
authorMarek Olšák <marek.olsak@amd.com>
Mon, 28 Aug 2017 21:28:33 +0000 (23:28 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 29 Aug 2017 11:18:37 +0000 (13:18 +0200)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102461

Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/state_tracker/st_mesa_to_tgsi.c

index 916f7fa2e865c3d756c919e89c7a0c375bcb4234..fa9fa440efdf8e09db1b84433dea7d05b1901353 100644 (file)
@@ -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]) );