diff options
author | Timothy Arceri <[email protected]> | 2017-08-09 13:34:04 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-08-11 10:43:21 +1000 |
commit | 49d9286a3f79800a94ddcffbe96a8894273db6d9 (patch) | |
tree | 1e5c6ee3530eeb1458f687d58c9b0db96510cb59 /src/compiler/glsl/ir_clone.cpp | |
parent | 43cbcbfee9ab4a6aa1fbb51a1af7fd9619d3b7f5 (diff) |
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 <[email protected]>
Diffstat (limited to 'src/compiler/glsl/ir_clone.cpp')
-rw-r--r-- | src/compiler/glsl/ir_clone.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/glsl/ir_clone.cpp b/src/compiler/glsl/ir_clone.cpp index 941e0865cb5..4fb9fa31f9b 100644 --- a/src/compiler/glsl/ir_clone.cpp +++ b/src/compiler/glsl/ir_clone.cpp @@ -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 * |