freedreno: disallow cat4 immed src
authorRob Clark <robclark@freedesktop.org>
Mon, 25 Apr 2016 12:24:43 +0000 (08:24 -0400)
committerRob Clark <robclark@freedesktop.org>
Mon, 25 Apr 2016 20:16:21 +0000 (16:16 -0400)
Normally this would never happen (constant-propagation in NIR would
eliminate the instruction), except it does happen for 'undef' which
we turn into immed 0.0 for bookkeeping purposes.

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

index e8a2f099391f9e2dcbadf3ba6edcc2cceb184ead..cec26fa4f57f9c747ff66b3c3afd3ff019bc07cc 100644 (file)
@@ -176,7 +176,7 @@ static bool valid_flags(struct ir3_instruction *instr, unsigned n,
        case 4:
                /* seems like blob compiler avoids const as src.. */
                /* TODO double check if this is still the case on a4xx */
-               if (flags & IR3_REG_CONST)
+               if (flags & (IR3_REG_CONST | IR3_REG_IMMED))
                        return false;
                if (flags & (IR3_REG_SABS | IR3_REG_SNEG))
                        return false;