[Mesa-dev] [PATCH 1/9] i965: Don't print extra (null) arguments in dump_instruction().

Matt Turner mattst88 at gmail.com
Mon Dec 2 13:28:34 PST 2013


---
 src/mesa/drivers/dri/i965/brw_fs.cpp   | 4 ++--
 src/mesa/drivers/dri/i965/brw_vec4.cpp | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 2d41c3f..b59ab82 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -2868,7 +2868,7 @@ fs_visitor::dump_instruction(backend_instruction *be_inst)
    }
    printf(", ");
 
-   for (int i = 0; i < 3; i++) {
+   for (int i = 0; i < 3 && inst->src[i].file != BAD_FILE; i++) {
       if (inst->src[i].negate)
          printf("-");
       if (inst->src[i].abs)
@@ -2924,7 +2924,7 @@ fs_visitor::dump_instruction(backend_instruction *be_inst)
       if (inst->src[i].abs)
          printf("|");
 
-      if (i < 3)
+      if (i < 2 && inst->src[i + 1].file != BAD_FILE)
          printf(", ");
    }
 
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
index 5222a67..fed6e61 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
@@ -1138,7 +1138,7 @@ vec4_visitor::dump_instruction(backend_instruction *be_inst)
    }
    printf(", ");
 
-   for (int i = 0; i < 3; i++) {
+   for (int i = 0; i < 3 && inst->src[i].file != BAD_FILE; i++) {
       switch (inst->src[i].file) {
       case GRF:
          printf("vgrf%d", inst->src[i].reg);
@@ -1182,7 +1182,7 @@ vec4_visitor::dump_instruction(backend_instruction *be_inst)
          printf("%s", chans[BRW_GET_SWZ(inst->src[i].swizzle, c)]);
       }
 
-      if (i < 3)
+      if (i < 2 && inst->src[i + 1].file != BAD_FILE)
          printf(", ");
    }
 
-- 
1.8.3.2



More information about the mesa-dev mailing list