From: Eric Anholt Date: Thu, 29 Jul 2010 21:20:39 +0000 (-0700) Subject: glsl2: When dumping IR for debug, skip all the empty builtin prototypes. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9a8eb684d4cd602b6c5e6876cd1eceabc3a8896c;p=mesa.git glsl2: When dumping IR for debug, skip all the empty builtin prototypes. --- 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"); }