summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_clone.cpp
diff options
context:
space:
mode:
authorTapani Pälli <[email protected]>2013-12-12 17:13:32 +0200
committerTapani Pälli <[email protected]>2013-12-12 17:28:13 +0200
commita6345f1559300e4eb51a36a1d0f15d6bc8b47dfb (patch)
tree81e8048fab5fbd6544c60fac35222359a48bb7a6 /src/glsl/ir_clone.cpp
parent447bb9029f7e03b03e507053b9f63536d8fc74ac (diff)
glsl: modify ir_clone to use memcpy
Patch copies the whole data structure at once instead of assigning individual variables. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/glsl/ir_clone.cpp')
-rw-r--r--src/glsl/ir_clone.cpp23
1 files changed, 3 insertions, 20 deletions
diff --git a/src/glsl/ir_clone.cpp b/src/glsl/ir_clone.cpp
index 09353a0a869..4e5cf68caa5 100644
--- a/src/glsl/ir_clone.cpp
+++ b/src/glsl/ir_clone.cpp
@@ -50,27 +50,10 @@ ir_variable::clone(void *mem_ctx, struct hash_table *ht) const
memcpy(var->max_ifc_array_access, this->max_ifc_array_access,
this->interface_type->length * sizeof(unsigned));
}
- var->data.read_only = this->data.read_only;
- var->data.centroid = this->data.centroid;
- var->data.sample = this->data.sample;
- var->data.invariant = this->data.invariant;
- var->data.interpolation = this->data.interpolation;
- var->data.location = this->data.location;
- var->data.index = this->data.index;
- var->data.binding = this->data.binding;
- var->data.atomic.buffer_index = this->data.atomic.buffer_index;
- var->data.atomic.offset = this->data.atomic.offset;
+
+ memcpy(&var->data, &this->data, sizeof(var->data));
+
var->warn_extension = this->warn_extension;
- var->data.origin_upper_left = this->data.origin_upper_left;
- var->data.pixel_center_integer = this->data.pixel_center_integer;
- var->data.explicit_location = this->data.explicit_location;
- var->data.explicit_index = this->data.explicit_index;
- var->data.explicit_binding = this->data.explicit_binding;
- var->data.has_initializer = this->data.has_initializer;
- var->data.depth_layout = this->data.depth_layout;
- var->data.assigned = this->data.assigned;
- var->data.how_declared = this->data.how_declared;
- var->data.used = this->data.used;
var->num_state_slots = this->num_state_slots;
if (this->state_slots) {