glsl: print non-zero bindings of variables
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 13 Oct 2016 13:27:00 +0000 (15:27 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 17 Oct 2016 17:09:33 +0000 (19:09 +0200)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/compiler/glsl/ir_print_visitor.cpp

index c238c16aa380d777522a7cb01e7b30a6d0641cad..efb728b1662186deda0dfdae3cab1347cb3b142e 100644 (file)
@@ -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]);