diff options
author | Nicolai Hähnle <[email protected]> | 2016-10-06 23:10:10 +0200 |
---|---|---|
committer | Nicolai Hähnle <[email protected]> | 2016-10-12 18:50:10 +0200 |
commit | 14aaaa1b4b3dfe8bec897ec0ee289a51627af7bd (patch) | |
tree | bd7942089ddd001fa3df9b20314923c213c75726 /src/compiler/glsl | |
parent | 2b460c750a3cd4acbe05036e92e860800b6d5a96 (diff) |
glsl: dump explicit location when printing IR
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Edward O'Callaghan <[email protected]>
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r-- | src/compiler/glsl/ir_print_visitor.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/compiler/glsl/ir_print_visitor.cpp b/src/compiler/glsl/ir_print_visitor.cpp index fc01be935bf..c238c16aa38 100644 --- a/src/compiler/glsl/ir_print_visitor.cpp +++ b/src/compiler/glsl/ir_print_visitor.cpp @@ -165,10 +165,14 @@ void ir_print_visitor::visit(ir_variable *ir) { fprintf(f, "(declare "); - char loc[256] = {0}; + char loc[32] = {0}; if (ir->data.location != -1) snprintf(loc, sizeof(loc), "location=%i ", ir->data.location); + char component[32] = {0}; + if (ir->data.explicit_component) + snprintf(component, sizeof(component), "component=%i ", ir->data.location_frac); + const char *const cent = (ir->data.centroid) ? "centroid " : ""; const char *const samp = (ir->data.sample) ? "sample " : ""; const char *const patc = (ir->data.patch) ? "patch " : ""; @@ -183,8 +187,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) ", - loc, cent, samp, patc, inv, prec, mode[ir->data.mode], + fprintf(f, "(%s%s%s%s%s%s%s%s%s%s) ", + loc, component, cent, samp, patc, inv, prec, mode[ir->data.mode], stream[ir->data.stream], interp[ir->data.interpolation]); |