diff options
author | Eric Anholt <[email protected]> | 2010-07-29 14:20:39 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2010-07-29 14:38:04 -0700 |
commit | 9a8eb684d4cd602b6c5e6876cd1eceabc3a8896c (patch) | |
tree | 28d204a4e62088dbd74253c166117b1e92e75498 | |
parent | 62c4763b707e2227409f81b09dd5cf6e4410ea6a (diff) |
glsl2: When dumping IR for debug, skip all the empty builtin prototypes.
-rw-r--r-- | src/glsl/ir_print_visitor.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/glsl/ir_print_visitor.cpp b/src/glsl/ir_print_visitor.cpp index ee489cda7f3..88a0a6f0c88 100644 --- a/src/glsl/ir_print_visitor.cpp +++ b/src/glsl/ir_print_visitor.cpp @@ -57,8 +57,10 @@ _mesa_print_ir(exec_list *instructions, printf("(\n"); foreach_iter(exec_list_iterator, iter, *instructions) { - ((ir_instruction *)iter.get())->print(); - printf("\n"); + ir_instruction *ir = (ir_instruction *)iter.get(); + ir->print(); + if (ir->ir_type != ir_type_function) + printf("\n"); } printf("\n)"); } @@ -122,6 +124,16 @@ void ir_print_visitor::visit(ir_function_signature *ir) void ir_print_visitor::visit(ir_function *ir) { + bool found_non_builtin_proto = false; + + foreach_iter(exec_list_iterator, iter, *ir) { + ir_function_signature *const sig = (ir_function_signature *) iter.get(); + if (sig->is_defined || !sig->is_built_in) + found_non_builtin_proto = true; + } + if (!found_non_builtin_proto) + return; + printf("(function %s\n", ir->name); foreach_iter(exec_list_iterator, iter, *ir) { ir_function_signature *const sig = (ir_function_signature *) iter.get(); @@ -130,7 +142,7 @@ void ir_print_visitor::visit(ir_function *ir) printf("\n"); } - printf(")\n"); + printf(")\n\n"); } |