st/nine: Do not use scratch for face register
authorAxel Davy <davyaxel0@gmail.com>
Thu, 5 Apr 2018 21:46:48 +0000 (23:46 +0200)
committerAxel Davy <davyaxel0@gmail.com>
Sun, 8 Apr 2018 20:49:43 +0000 (22:49 +0200)
Scratch registers are reused every instructions.
Since vFace is reused, a new temporary register
should be used.

Fixes: https://github.com/iXit/Mesa-3D/issues/311
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
CC: "17.3 18.0" <mesa-stable@lists.freedesktop.org>
src/gallium/state_trackers/nine/nine_shader.c

index cc667ebfbcd9a81f1047d27a72275ef8f99dbe7e..422df931c74201312f6947af1b71dee1619d88a0 100644 (file)
@@ -1079,7 +1079,7 @@ tx_src_param(struct shader_translator *tx, const struct sm1_src_param *param)
         case D3DSMO_FACE:
            if (ureg_src_is_undef(tx->regs.vFace)) {
                if (tx->face_is_sysval_integer) {
-                   tmp = tx_scratch(tx);
+                   tmp = ureg_DECL_temporary(ureg);
                    tx->regs.vFace =
                        ureg_DECL_system_value(ureg, TGSI_SEMANTIC_FACE, 0);