v3d: Simplify VIR uniform dumping using a temporary.
authorEric Anholt <eric@anholt.net>
Tue, 4 Dec 2018 23:01:58 +0000 (15:01 -0800)
committerEric Anholt <eric@anholt.net>
Sat, 8 Dec 2018 00:48:23 +0000 (16:48 -0800)
src/broadcom/compiler/vir_dump.c

index c43578302b58cd8d42098d510cdfe63dcec715eb..f02413c6877a1e2c64417f07099be1a844ed57bc 100644 (file)
@@ -86,50 +86,41 @@ vir_print_reg(struct v3d_compile *c, const struct qinst *inst,
 
         case QFILE_UNIF: {
                 enum quniform_contents contents = c->uniform_contents[reg.index];
+                uint32_t data = c->uniform_data[reg.index];
 
                 fprintf(stderr, "%s%d", files[reg.file], reg.index);
 
                 switch (contents) {
                 case QUNIFORM_CONSTANT:
-                        fprintf(stderr, " (0x%08x / %f)",
-                                c->uniform_data[reg.index],
-                                uif(c->uniform_data[reg.index]));
+                        fprintf(stderr, " (0x%08x / %f)", data, uif(data));
                         break;
 
                 case QUNIFORM_UNIFORM:
-                        fprintf(stderr, " (push[%d])",
-                                c->uniform_data[reg.index]);
+                        fprintf(stderr, " (push[%d])", data);
                         break;
 
                 case QUNIFORM_TEXTURE_CONFIG_P1:
-                        fprintf(stderr, " (tex[%d].p1)",
-                                c->uniform_data[reg.index]);
+                        fprintf(stderr, " (tex[%d].p1)", data);
                         break;
 
                 case QUNIFORM_TEXTURE_WIDTH:
-                        fprintf(stderr, " (tex[%d].width)",
-                                c->uniform_data[reg.index]);
+                        fprintf(stderr, " (tex[%d].width)", data);
                         break;
                 case QUNIFORM_TEXTURE_HEIGHT:
-                        fprintf(stderr, " (tex[%d].height)",
-                                c->uniform_data[reg.index]);
+                        fprintf(stderr, " (tex[%d].height)", data);
                         break;
                 case QUNIFORM_TEXTURE_DEPTH:
-                        fprintf(stderr, " (tex[%d].depth)",
-                                c->uniform_data[reg.index]);
+                        fprintf(stderr, " (tex[%d].depth)", data);
                         break;
                 case QUNIFORM_TEXTURE_ARRAY_SIZE:
-                        fprintf(stderr, " (tex[%d].array_size)",
-                                c->uniform_data[reg.index]);
+                        fprintf(stderr, " (tex[%d].array_size)", data);
                         break;
                 case QUNIFORM_TEXTURE_LEVELS:
-                        fprintf(stderr, " (tex[%d].levels)",
-                                c->uniform_data[reg.index]);
+                        fprintf(stderr, " (tex[%d].levels)", data);
                         break;
 
                 case QUNIFORM_UBO_ADDR:
-                        fprintf(stderr, " (ubo[%d])",
-                                c->uniform_data[reg.index]);
+                        fprintf(stderr, " (ubo[%d])", data);
                         break;
 
                 default: