On Thursday, January 21, 2016 11:35:31 PM PST Jordan Justen wrote: > Signed-off-by: Jordan Justen <jordan.l.jus...@intel.com> > --- > > I tested a release build. I think v1 produced comparable code to > before the patch, but it was a bit larger. I found that this v2 code > would produce identical code to our current code for release builds. > > Timothy, should I add your r-b for v2? > > src/glsl/glsl_parser_extras.cpp | 81 ++++++++++++++++++++++++ +---------------- > 1 file changed, 49 insertions(+), 32 deletions(-) > > diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/ glsl_parser_extras.cpp > index 1d74db5..1c1bf78 100644 > --- a/src/glsl/glsl_parser_extras.cpp > +++ b/src/glsl/glsl_parser_extras.cpp > @@ -1864,59 +1864,76 @@ do_common_optimization(exec_list *ir, bool linked, > const struct gl_shader_compiler_options *options, > bool native_integers) > { > + const bool debug = false; > GLboolean progress = GL_FALSE; > > - progress = lower_instructions(ir, SUB_TO_ADD_NEG) || progress; > +#define OPT(PASS, ...) do { \ > + if (debug) { \ > + printf("START GLSL optimization %s\n", #PASS); \
Can we use stderr rather than stdout? Most of our debugging messages go there already, and if we use both, things just get jumbled. fprintf(stderr, ... > + const bool opt_progress = PASS(__VA_ARGS__); \ > + progress = opt_progress || progress; \ > + if (opt_progress) \ > + _mesa_print_ir(stdout, ir, NULL); \ stderr > + printf("GLSL optimization %s: %s progress\n", \ > + #PASS, opt_progress ? "made" : "no"); \ fprintf(stderr, ... Either way, Reviewed-by: Kenneth Graunke <kenn...@whitecape.org> Thanks so much for doing this. I'd hacked this up several times, but always threw it away after debugging my problem. That was arguably pretty stupid; I'm really glad to see this land properly.
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev