glsl: Unify ir_constant::const_elements and ::components
There was no reason to treat array types and record types differently. Unifying them saves a bunch of code and saves a few bytes in every ir_constant. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
This commit is contained in:
@@ -469,13 +469,10 @@ void ir_print_visitor::visit(ir_constant *ir)
|
||||
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++) {
|
||||
|
Reference in New Issue
Block a user