From 9ac8fece63a9e980971b0cc894c60a9d8db4037d Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 7 Sep 2017 19:23:51 -0700 Subject: glsl: Unify ir_constant::const_elements and ::components MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Alejandro PiƱeiro Reviewed-by: Elie Tournier --- src/compiler/glsl/ir_clone.cpp | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'src/compiler/glsl/ir_clone.cpp') diff --git a/src/compiler/glsl/ir_clone.cpp b/src/compiler/glsl/ir_clone.cpp index 114367c8555..12135070892 100644 --- a/src/compiler/glsl/ir_clone.cpp +++ b/src/compiler/glsl/ir_clone.cpp @@ -345,21 +345,7 @@ ir_constant::clone(void *mem_ctx, struct hash_table *ht) const case GLSL_TYPE_IMAGE: return new(mem_ctx) ir_constant(this->type, &this->value); - case GLSL_TYPE_STRUCT: { - ir_constant *c = new(mem_ctx) ir_constant; - - c->type = this->type; - for (const exec_node *node = this->components.get_head_raw() - ; !node->is_tail_sentinel() - ; node = node->next) { - ir_constant *const orig = (ir_constant *) node; - - c->components.push_tail(orig->clone(mem_ctx, NULL)); - } - - return c; - } - + case GLSL_TYPE_STRUCT: case GLSL_TYPE_ARRAY: { ir_constant *c = new(mem_ctx) ir_constant; -- cgit v1.2.3