print_type(const glsl_type *t)
{
if (t->base_type == GLSL_TYPE_ARRAY) {
- printf("array\n");
- printf(" (");
+ printf("array (");
print_type(t->fields.array);
- printf(")\n");
-
- printf(" (%u)\n", t->length);
- printf(")");
+ printf(") (%u))", t->length);
} else if (t->base_type == GLSL_TYPE_STRUCT) {
- printf("struct (%s %u\n", t->name ? t->name : "@", t->length);
- printf(" (FINISHME: structure fields go here)\n");
+ printf("struct (%s %u ", t->name ? t->name : "@", t->length);
+ printf("(FINISHME: structure fields go here) ");
printf(")");
} else {
printf("%s", t->name);
printf("(");
print_type(ir->type);
printf(") ");
- printf("(%s))\n", ir->name);
+ printf("(%s)) ", ir->name);
}
}
void ir_print_visitor::visit(ir_label *ir)
{
- printf("(label %s)\n", ir->label);
+ printf("\n(label %s)", ir->label);
}
for (unsigned i = 0; i < ir->selector.swizzle.num_components; i++) {
printf("%c", "xyzw"[swiz[i]]);
}
- printf("))\n");
+ printf(")) ");
break;
}
case ir_dereference::ir_reference_array:
printf("(array_ref ");
ir->var->accept(this);
ir->selector.array_index->accept(this);
- printf(")\n");
+ printf(") ");
break;
case ir_dereference::ir_reference_record:
printf("(record_ref ");
ir->var->accept(this);
- printf("(%s))\n", ir->selector.field);
+ printf("(%s)) ", ir->selector.field);
break;
}
void ir_print_visitor::visit(ir_assignment *ir)
{
- printf("(assign\n");
+ printf("(assign (");
- printf(" (");
if (ir->condition)
ir->condition->accept(this);
else
printf("true");
- printf(")\n");
- printf(" (");
+ printf(") (");
+
ir->lhs->accept(this);
- printf(")\n");
- printf(" (");
+ printf(") (");
+
ir->rhs->accept(this);
- printf(")\n");
+ printf(") ");
}
{
(void) ir;
- printf("(constant\n");
- printf(" (");
+ printf("(constant (");
print_type(ir->type);
- printf(")\n");
- printf(" (FINISHME: value goes here)\n");
- printf(")\n");
+ printf(") ");
+ printf("(FINISHME: value goes here)");
+ printf(") ");
}
value->accept(this);
}
- printf(")\n");
+ printf(")");
}