[Mesa-dev] [PATCH 21/53] st/nine: Correctly declare NineTranslateInstruction_Mkxn inputs
Axel Davy
axel.davy at ens.fr
Wed Jan 7 08:36:31 PST 2015
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.
Signed-off-by: Axel Davy <axel.davy at ens.fr>
Cc: "10.4" <mesa-stable at lists.freedesktop.org>
---
src/gallium/state_trackers/nine/nine_shader.c | 7 +++++--
1 file 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 6320f36..0b378d5 100644
--- a/src/gallium/state_trackers/nine/nine_shader.c
+++ b/src/gallium/state_trackers/nine/nine_shader.c
@@ -1168,16 +1168,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;
--
2.1.3
More information about the mesa-dev
mailing list