i965/vs: Add IR dumping for immediates.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 11 Mar 2013 18:10:34 +0000 (11:10 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 20 Mar 2013 17:40:44 +0000 (10:40 -0700)
This makes dump_instructions more useful.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_vec4.cpp

index d759710af3cc75f171ac12f5d8716caf8b5f9f43..9ab599f4b2115bb186a6ccb2b4ce059addf7bef8 100644 (file)
@@ -981,6 +981,22 @@ vec4_visitor::dump_instruction(vec4_instruction *inst)
       case UNIFORM:
          printf("u%d", inst->src[i].reg);
          break;
+      case IMM:
+         switch (inst->src[i].type) {
+         case BRW_REGISTER_TYPE_F:
+            printf("%fF", inst->src[i].imm.f);
+            break;
+         case BRW_REGISTER_TYPE_D:
+            printf("%dD", inst->src[i].imm.i);
+            break;
+         case BRW_REGISTER_TYPE_UD:
+            printf("%uU", inst->src[i].imm.u);
+            break;
+         default:
+            printf("???");
+            break;
+         }
+         break;
       case BAD_FILE:
          printf("(null)");
          break;