static void
print_type(FILE *f, const glsl_type *t)
{
- if (t->base_type == GLSL_TYPE_ARRAY) {
+ if (t->is_array()) {
fprintf(f, "(array ");
print_type(f, t->fields.array);
fprintf(f, " %u)", t->length);
- } else if ((t->base_type == GLSL_TYPE_STRUCT)
- && !is_gl_identifier(t->name)) {
+ } else if (t->is_record() && !is_gl_identifier(t->name)) {
fprintf(f, "%s@%p", t->name, (void *) t);
} else {
fprintf(f, "%s", t->name);
snprintf(loc, sizeof(loc), "location=%i ", ir->data.location);
char component[32] = {0};
- if (ir->data.explicit_component)
+ if (ir->data.explicit_component || ir->data.location_frac != 0)
snprintf(component, sizeof(component), "component=%i ", ir->data.location_frac);
char stream[32] = {0};
snprintf(stream, sizeof(stream), "stream%u ", ir->data.stream);
}
+ char image_format[32] = {0};
+ if (ir->data.image_format) {
+ snprintf(image_format, sizeof(image_format), "format=%x ",
+ ir->data.image_format);
+ }
+
const char *const cent = (ir->data.centroid) ? "centroid " : "";
const char *const samp = (ir->data.sample) ? "sample " : "";
const char *const patc = (ir->data.patch) ? "patch " : "";
const char *const inv = (ir->data.invariant) ? "invariant " : "";
const char *const prec = (ir->data.precise) ? "precise " : "";
+ const char *const bindless = (ir->data.bindless) ? "bindless " : "";
+ const char *const bound = (ir->data.bound) ? "bound " : "";
+ const char *const memory_read_only = (ir->data.memory_read_only) ? "readonly " : "";
+ const char *const memory_write_only = (ir->data.memory_write_only) ? "writeonly " : "";
+ const char *const memory_coherent = (ir->data.memory_coherent) ? "coherent " : "";
+ const char *const memory_volatile = (ir->data.memory_volatile) ? "volatile " : "";
+ const char *const memory_restrict = (ir->data.memory_restrict) ? "restrict " : "";
const char *const mode[] = { "", "uniform ", "shader_storage ",
"shader_shared ", "shader_in ", "shader_out ",
"in ", "out ", "inout ",
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%s) ",
- binding, loc, component, cent, samp, patc, inv, prec, mode[ir->data.mode],
+ fprintf(f, "(%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s) ",
+ binding, loc, component, cent, bindless, bound,
+ image_format, memory_read_only, memory_write_only,
+ memory_coherent, memory_volatile, memory_restrict,
+ samp, patc, inv, prec, mode[ir->data.mode],
stream,
interp[ir->data.interpolation]);
fprintf(f, " %s ", ir_expression_operation_strings[ir->operation]);
- for (unsigned i = 0; i < ir->get_num_operands(); i++) {
+ for (unsigned i = 0; i < ir->num_operands; i++) {
ir->operands[i]->accept(this);
}
{
fprintf(f, "(record_ref ");
ir->record->accept(this);
- fprintf(f, " %s) ", ir->field);
+
+ const char *field_name =
+ ir->record->type->fields.structure[ir->field_idx].name;
+ fprintf(f, " %s) ", field_name);
}
for (unsigned i = 0; i < ir->type->length; i++)
ir->get_array_element(i)->accept(this);
} else if (ir->type->is_record()) {
- ir_constant *value = (ir_constant *) ir->components.get_head();
for (unsigned i = 0; i < ir->type->length; i++) {
fprintf(f, "(%s ", ir->type->fields.structure[i].name);
- value->accept(this);
+ ir->get_record_field(i)->accept(this);
fprintf(f, ")");
-
- value = (ir_constant *) value->next;
}
} else {
for (unsigned i = 0; i < ir->type->components(); i++) {
else
fprintf(f, "%f", ir->value.f[i]);
break;
- case GLSL_TYPE_UINT64:fprintf(f, "%" PRIu64, ir->value.u64[i]); break;
+ case GLSL_TYPE_SAMPLER:
+ case GLSL_TYPE_IMAGE:
+ case GLSL_TYPE_UINT64:
+ fprintf(f, "%" PRIu64, ir->value.u64[i]);
+ break;
case GLSL_TYPE_INT64: fprintf(f, "%" PRIi64, ir->value.i64[i]); break;
case GLSL_TYPE_BOOL: fprintf(f, "%d", ir->value.b[i]); break;
case GLSL_TYPE_DOUBLE: