diff options
author | Axel Davy <[email protected]> | 2014-12-26 09:22:26 +0100 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2015-01-22 23:43:26 +0000 |
commit | 7f700cc35bb3a140850854914aa6c191a5d76dcb (patch) | |
tree | aabdc159aaf3b3c8303579def407a764726d43e5 | |
parent | e6167e749c4c3d8cb00002d4d14379e01d63be1d (diff) |
st/nine: Correctly declare NineTranslateInstruction_Mkxn inputs
Let's say we have c1 and c2 declared in the shader and c0 given by the app
Then here we would have read c0, c1 and c2 given by the app, instead
of the correct c0, c1, c2.
This correction fixes several issues in some games.
Reviewed-by: Ilia Mirkin <[email protected]>
Signed-off-by: Axel Davy <[email protected]>
Cc: "10.4" <[email protected]>
(cherry picked from commit 53dc992f204678acb9af9d1b11c1be371400930c)
-rw-r--r-- | src/gallium/state_trackers/nine/nine_shader.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c index 3f7b6f98eff..5a45a762838 100644 --- a/src/gallium/state_trackers/nine/nine_shader.c +++ b/src/gallium/state_trackers/nine/nine_shader.c @@ -1158,16 +1158,19 @@ NineTranslateInstruction_Mkxn(struct shader_translator *tx, const unsigned k, co struct ureg_program *ureg = tx->ureg; struct ureg_dst dst; struct ureg_src src[2]; + struct sm1_src_param *src_mat = &tx->insn.src[1]; unsigned i; dst = tx_dst_param(tx, &tx->insn.dst[0]); src[0] = tx_src_param(tx, &tx->insn.src[0]); - src[1] = tx_src_param(tx, &tx->insn.src[1]); - for (i = 0; i < n; i++, src[1].Index++) + for (i = 0; i < n; i++) { const unsigned m = (1 << i); + src[1] = tx_src_param(tx, src_mat); + src_mat->idx++; + if (!(dst.WriteMask & m)) continue; |