From 0e4053234df5e3461e80c90dfd743c3ac96006eb Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Mon, 25 Nov 2013 15:15:25 -0800 Subject: [PATCH] i965: Don't print extra (null) arguments in dump_instruction(). Reviewed-by: Eric Anholt --- 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 2d41c3fc19f..b59ab82c2ae 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 5222a67dab2..fed6e6182b7 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(", "); } -- 2.30.2