freedreno/ir3: workaround bug/feature
authorRob Clark <robclark@freedesktop.org>
Fri, 15 Jan 2016 22:07:02 +0000 (17:07 -0500)
committerRob Clark <robclark@freedesktop.org>
Sat, 16 Jan 2016 19:22:43 +0000 (14:22 -0500)
Seems like in certain cases, we cannot use c<a0.x+0> as the third src to
cat3 instructions.  This may be slightly conservative, we may only have
this restriction when the first src is also const.

This fixes, for example, +24/-0 of the variable-indexing piglit tests.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/ir3/ir3_cp.c

index 0d88e7bc3ab98b1e827bd4d499a17609886d147b..1cc211a766384fdbd8e9f766caf71a5e2d870fbd 100644 (file)
@@ -288,6 +288,15 @@ reg_cp(struct ir3_instruction *instr, struct ir3_register *reg, unsigned n)
                                        conflicts(instr->address, reg->instr->address))
                                return;
 
+                       /* This seems to be a hw bug, or something where the timings
+                        * just somehow don't work out.  This restriction may only
+                        * apply if the first src is also CONST.
+                        */
+                       if ((instr->category == 3) && (n == 2) &&
+                                       (src_reg->flags & IR3_REG_RELATIV) &&
+                                       (src_reg->array.offset == 0))
+                               return;
+
                        src_reg = ir3_reg_clone(instr->block->shader, src_reg);
                        src_reg->flags = new_flags;
                        instr->regs[n+1] = src_reg;