{
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 " : "";
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]);