diff options
Diffstat (limited to 'src/glsl/ir_clone.cpp')
-rw-r--r-- | src/glsl/ir_clone.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/glsl/ir_clone.cpp b/src/glsl/ir_clone.cpp index f7e8794728c..a3e4a3ae311 100644 --- a/src/glsl/ir_clone.cpp +++ b/src/glsl/ir_clone.cpp @@ -337,6 +337,17 @@ ir_constant::clone(struct hash_table *ht) const return c; } + case GLSL_TYPE_ARRAY: { + ir_constant *c = new(ctx) ir_constant; + + c->type = this->type; + c->array_elements = talloc_array(c, ir_constant *, this->type->length); + for (unsigned i = 0; i < this->type->length; i++) { + c->array_elements[i] = this->array_elements[i]->clone(NULL); + } + return c; + } + default: assert(!"Should not get here."); break; return NULL; |