st/nine: Do not pollute rTmp in ff ps
authorAxel Davy <axel.davy@ens.fr>
Sun, 25 Sep 2016 12:50:32 +0000 (14:50 +0200)
committerAxel Davy <axel.davy@ens.fr>
Mon, 10 Oct 2016 21:43:50 +0000 (23:43 +0200)
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
src/gallium/state_trackers/nine/nine_ff.c

index 680b9671552064837f6e819e8cf54acac34a1b6d..1fc96fbdc8a8bcc4c7d985766759d87729d09476 100644 (file)
@@ -1429,9 +1429,11 @@ nine_ff_build_ps(struct NineDevice9 *device, struct nine_ff_ps_key *key)
                 if (dim == 4)
                     ureg_TXP(ureg, ps.rTex, target, texture_coord, ps.s[s]);
                 else {
-                    ureg_RCP(ureg, ureg_writemask(ps.rTmp, TGSI_WRITEMASK_X), ureg_scalar(texture_coord, dim-1));
-                    ureg_MUL(ureg, ps.rTmp, _XXXX(ps.rTmpSrc), texture_coord);
+                    struct ureg_dst tmp = ureg_DECL_temporary(ureg);
+                    ureg_RCP(ureg, ureg_writemask(tmp, TGSI_WRITEMASK_X), ureg_scalar(texture_coord, dim-1));
+                    ureg_MUL(ureg, ps.rTmp, _X(tmp), texture_coord);
                     ureg_TEX(ureg, ps.rTex, target, ps.rTmpSrc, ps.s[s]);
+                    ureg_release_temporary(ureg, tmp);
                 }
             } else {
                 ureg_TEX(ureg, ps.rTex, target, texture_coord, ps.s[s]);