freedreno/ir3/cmdline: add @const headers for immediates
authorRob Clark <robclark@freedesktop.org>
Wed, 1 Apr 2015 14:52:29 +0000 (10:52 -0400)
committerRob Clark <robclark@freedesktop.org>
Sun, 5 Apr 2015 20:36:34 +0000 (16:36 -0400)
Since NIR f/e currently encodes immediates in instructions (rather than
passing via const), we need to ensure that when const's are used the get
initialized to the proper values.  Otherwise comparing NIR to TGSI
compiler, it will use proper immediate values in one case, and randomly
initialize values in the other.  Which confuses ir3test.

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

index 9d0702a275536817d0caa20ff8d95eb1f0ab0cff..81d0180933fc5945004fc0714c7f55ed2064bf8e 100644 (file)
@@ -99,6 +99,15 @@ static void dump_info(struct ir3_shader_variant *so, const char *str)
                                        (regid >> 2), "xyzw"[regid & 0x3], i);
                }
 
+               for (i = 0; i < so->immediates_count; i++) {
+                       debug_printf("@const(c%d.x)\t", so->first_immediate + i);
+                       debug_printf("0x%08x, 0x%08x, 0x%08x, 0x%08x\n",
+                                       so->immediates[i].val[0],
+                                       so->immediates[i].val[1],
+                                       so->immediates[i].val[2],
+                                       so->immediates[i].val[3]);
+               }
+
                disasm_a3xx(bin, so->info.sizedwords, 0, so->type);
 
                debug_printf("; %s: outputs:", type);