From e0213f36bb9e2aebd84845d3c06fcc74cc749f0f Mon Sep 17 00:00:00 2001 From: Nicolai Hähnle Date: Thu, 13 Oct 2016 15:27:00 +0200 Subject: glsl: print non-zero bindings of variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák --- src/compiler/glsl/ir_print_visitor.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/compiler/glsl') diff --git a/src/compiler/glsl/ir_print_visitor.cpp b/src/compiler/glsl/ir_print_visitor.cpp index c238c16aa38..efb728b1662 100644 --- a/src/compiler/glsl/ir_print_visitor.cpp +++ b/src/compiler/glsl/ir_print_visitor.cpp @@ -165,6 +165,10 @@ void ir_print_visitor::visit(ir_variable *ir) { fprintf(f, "(declare "); + char binding[32] = {0}; + if (ir->data.binding) + snprintf(binding, sizeof(binding), "binding=%i ", ir->data.binding); + char loc[32] = {0}; if (ir->data.location != -1) snprintf(loc, sizeof(loc), "location=%i ", ir->data.location); @@ -187,8 +191,8 @@ void ir_print_visitor::visit(ir_variable *ir) const char *const interp[] = { "", "smooth", "flat", "noperspective" }; STATIC_ASSERT(ARRAY_SIZE(interp) == INTERP_MODE_COUNT); - fprintf(f, "(%s%s%s%s%s%s%s%s%s%s) ", - loc, component, cent, samp, patc, inv, prec, mode[ir->data.mode], + fprintf(f, "(%s%s%s%s%s%s%s%s%s%s%s) ", + binding, loc, component, cent, samp, patc, inv, prec, mode[ir->data.mode], stream[ir->data.stream], interp[ir->data.interpolation]); -- cgit v1.2.3