glsl: dump explicit location when printing IR
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
@@ -165,10 +165,14 @@ void ir_print_visitor::visit(ir_variable *ir)
|
|||||||
{
|
{
|
||||||
fprintf(f, "(declare ");
|
fprintf(f, "(declare ");
|
||||||
|
|
||||||
char loc[256] = {0};
|
char loc[32] = {0};
|
||||||
if (ir->data.location != -1)
|
if (ir->data.location != -1)
|
||||||
snprintf(loc, sizeof(loc), "location=%i ", ir->data.location);
|
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 cent = (ir->data.centroid) ? "centroid " : "";
|
||||||
const char *const samp = (ir->data.sample) ? "sample " : "";
|
const char *const samp = (ir->data.sample) ? "sample " : "";
|
||||||
const char *const patc = (ir->data.patch) ? "patch " : "";
|
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" };
|
const char *const interp[] = { "", "smooth", "flat", "noperspective" };
|
||||||
STATIC_ASSERT(ARRAY_SIZE(interp) == INTERP_MODE_COUNT);
|
STATIC_ASSERT(ARRAY_SIZE(interp) == INTERP_MODE_COUNT);
|
||||||
|
|
||||||
fprintf(f, "(%s%s%s%s%s%s%s%s%s) ",
|
fprintf(f, "(%s%s%s%s%s%s%s%s%s%s) ",
|
||||||
loc, cent, samp, patc, inv, prec, mode[ir->data.mode],
|
loc, component, cent, samp, patc, inv, prec, mode[ir->data.mode],
|
||||||
stream[ir->data.stream],
|
stream[ir->data.stream],
|
||||||
interp[ir->data.interpolation]);
|
interp[ir->data.interpolation]);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user