break;
case GLSL_TYPE_STRUCT:
+ case GLSL_TYPE_INTERFACE:
for (i = 0; i < c->num_elements; i++) {
if (i > 0) fprintf(fp, ", ");
fprintf(fp, "{ ");
}
}
+static void
+print_alu_type(nir_alu_type type, print_state *state)
+{
+ FILE *fp = state->fp;
+ unsigned size = nir_alu_type_get_type_size(type);
+ const char *name;
+
+ switch (nir_alu_type_get_base_type(type)) {
+ case nir_type_int: name = "int"; break;
+ case nir_type_uint: name = "uint"; break;
+ case nir_type_bool: name = "bool"; break;
+ case nir_type_float: name = "float"; break;
+ default: name = "invalid";
+ }
+ if (size)
+ fprintf(fp, "%s%u", name, size);
+ else
+ fprintf(fp, "%s", name);
+}
+
static void
print_intrinsic_instr(nir_intrinsic_instr *instr, print_state *state)
{
}
case NIR_INTRINSIC_TYPE: {
- nir_alu_type type = nir_intrinsic_type(instr);
- unsigned size = nir_alu_type_get_type_size(type);
- const char *name;
- switch (nir_alu_type_get_base_type(type)) {
- case nir_type_int: name = "int"; break;
- case nir_type_uint: name = "uint"; break;
- case nir_type_bool: name = "bool"; break;
- case nir_type_float: name = "float"; break;
- default: name = "invalid";
- }
- if (size)
- fprintf(fp, " type=%s%u", name, size);
- else
- fprintf(fp, " type=%s", name);
+ fprintf(fp, " type=");
+ print_alu_type(nir_intrinsic_type(instr), state);
break;
}
case NIR_INTRINSIC_EXECUTION_SCOPE:
case NIR_INTRINSIC_MEMORY_SCOPE: {
fprintf(fp, " %s=", index_name[idx]);
- switch (nir_intrinsic_memory_scope(instr)) {
+ nir_scope scope =
+ idx == NIR_INTRINSIC_MEMORY_SCOPE ? nir_intrinsic_memory_scope(instr)
+ : nir_intrinsic_execution_scope(instr);
+ switch (scope) {
case NIR_SCOPE_NONE: fprintf(fp, "NONE"); break;
case NIR_SCOPE_DEVICE: fprintf(fp, "DEVICE"); break;
case NIR_SCOPE_QUEUE_FAMILY: fprintf(fp, "QUEUE_FAMILY"); break;
print_dest(&instr->dest, state);
- fprintf(fp, " = ");
+ fprintf(fp, " = (");
+ print_alu_type(instr->dest_type, state);
+ fprintf(fp, ")");
switch (instr->op) {
case nir_texop_tex:
fprintf(fp, "{\n");
- nir_foreach_variable(var, &impl->locals) {
+ nir_foreach_function_temp_variable(var, impl) {
fprintf(fp, "\t");
print_var_decl(var, state);
}