glsl: stop copying struct and interface member names
We are currently copying the name for each member dereference but we can just share a single instance of the string provided by the type. This change also stops us recalculating the field index repeatedly. Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
This commit is contained in:
@@ -423,7 +423,10 @@ void ir_print_visitor::visit(ir_dereference_record *ir)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user