Mesa (master): freedreno/ir3: Fix operand order for DSX/DSY

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Mar 26 01:49:23 UTC 2019


Module: Mesa
Branch: master
Commit: c7c432738a68d543dc1b73eae895ec4dfacd92b2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c7c432738a68d543dc1b73eae895ec4dfacd92b2

Author: Kristian H. Kristensen <hoegsberg at chromium.org>
Date:   Mon Mar 25 14:04:20 2019 -0700

freedreno/ir3: Fix operand order for DSX/DSY

Most cat5 instructions are constructed using ir3_SAM, which uses
regs[1] for the (sampler, tex) src. Not DSX/DSY though, so we look up
src1 and src2 differently for those two.

Fixes: 1dffb089 ("freedreno/ir3: fix sam.s2en encoding")
Signed-off-by: Kristian H. Kristensen <hoegsberg at chromium.org>
Reviewed-by: Rob Clark <robdclark at gmail.com>

---

 src/freedreno/ir3/ir3.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/freedreno/ir3/ir3.c b/src/freedreno/ir3/ir3.c
index 23b12a6fc5f..f209585dd9a 100644
--- a/src/freedreno/ir3/ir3.c
+++ b/src/freedreno/ir3/ir3.c
@@ -455,6 +455,21 @@ static int emit_cat5(struct ir3_instruction *instr, void *ptr,
 	struct ir3_register *src2 = instr->regs[3];
 	instr_cat5_t *cat5 = ptr;
 
+	switch (instr->opc) {
+	case OPC_DSX:
+	case OPC_DSXPP_1:
+	case OPC_DSY:
+	case OPC_DSYPP_1:
+		iassert((instr->flags & IR3_INSTR_S2EN) == 0);
+		src1 = instr->regs[1];
+		src2 = instr->regs[2];
+		break;
+	default:
+		src1 = instr->regs[2];
+		src2 = instr->regs[3];
+		break;
+	}
+
 	iassert_type(dst, type_size(instr->cat5.type) == 32)
 
 	assume(src1 || !src2);




More information about the mesa-commit mailing list