diff options
author | Marek Olšák <marek.olsak@amd.com> | 2015-03-19 23:28:25 +0100 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2015-06-16 15:47:02 +0200 |
commit | 2f86c22e75a3273a7541f88ffedd2edefaf6f482 (patch) | |
tree | 49d185fac1fa7c127bd091aea978f357eb291885 /src | |
parent | 797f4eacea8a6b08b7c9143a74c7f2b422d1535d (diff) |
glsl: print locations of variables
Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/glsl/ir_print_visitor.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/glsl/ir_print_visitor.cpp b/src/glsl/ir_print_visitor.cpp index f5de6ac065b..c991658ab4b 100644 --- a/src/glsl/ir_print_visitor.cpp +++ b/src/glsl/ir_print_visitor.cpp @@ -161,6 +161,10 @@ void ir_print_visitor::visit(ir_variable *ir) { fprintf(f, "(declare "); + char loc[256] = {0}; + if (ir->data.location != -1) + snprintf(loc, sizeof(loc), "location=%i ", ir->data.location); + const char *const cent = (ir->data.centroid) ? "centroid " : ""; const char *const samp = (ir->data.sample) ? "sample " : ""; const char *const inv = (ir->data.invariant) ? "invariant " : ""; @@ -172,8 +176,8 @@ void ir_print_visitor::visit(ir_variable *ir) const char *const interp[] = { "", "smooth", "flat", "noperspective" }; STATIC_ASSERT(ARRAY_SIZE(interp) == INTERP_QUALIFIER_COUNT); - fprintf(f, "(%s%s%s%s%s%s) ", - cent, samp, inv, mode[ir->data.mode], + fprintf(f, "(%s%s%s%s%s%s%s) ", + loc, cent, samp, inv, mode[ir->data.mode], stream[ir->data.stream], interp[ir->data.interpolation]); |