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:
@@ -194,8 +194,10 @@ ir_dereference_array::clone(void *mem_ctx, struct hash_table *ht) const
|
||||
ir_dereference_record *
|
||||
ir_dereference_record::clone(void *mem_ctx, struct hash_table *ht) const
|
||||
{
|
||||
const char *field_name =
|
||||
this->record->type->fields.structure[this->field_idx].name;
|
||||
return new(mem_ctx) ir_dereference_record(this->record->clone(mem_ctx, ht),
|
||||
this->field);
|
||||
field_name);
|
||||
}
|
||||
|
||||
ir_texture *
|
||||
|
Reference in New Issue
Block a user