summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_clone.cpp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2014-05-27 18:34:24 -0700
committerIan Romanick <ian.d.romanick@intel.com>2014-09-30 13:34:42 -0700
commita32ac726ee8825c8352337a0489dddaffd955d4a (patch)
treefec2b53f6d84c411f2268add7ef658e93483130a /src/glsl/ir_clone.cpp
parent5aa8d8194c4975876276a9c57cdd672978a491ad (diff)
downloadexternal_mesa3d-a32ac726ee8825c8352337a0489dddaffd955d4a.zip
external_mesa3d-a32ac726ee8825c8352337a0489dddaffd955d4a.tar.gz
external_mesa3d-a32ac726ee8825c8352337a0489dddaffd955d4a.tar.bz2
glsl: Squish ir_variable::max_ifc_array_access and ::state_slots together
At least one of these pointers must be NULL, and we can determine which will be NULL by looking at other fields. Use this information to store both pointers in the same location. If anyone can think of a better name for the union than "u", I'm all ears. Valgrind massif results for a trimmed apitrace of dota2: n time(i) total(B) useful-heap(B) extra-heap(B) stacks(B) Before (32-bit): 63 40,574,239,515 68,117,280 62,618,607 5,498,673 0 After (32-bit): 44 40,577,049,140 68,118,608 62,441,063 5,677,545 0 Before (64-bit): 53 37,126,451,468 95,150,256 87,711,304 7,438,952 0 After (64-bit): 63 37,122,829,194 95,153,008 87,333,600 7,819,408 0 A real savings of 173KiB on 32-bit and 368KiB on 64-bit. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Diffstat (limited to 'src/glsl/ir_clone.cpp')
-rw-r--r--src/glsl/ir_clone.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/glsl/ir_clone.cpp b/src/glsl/ir_clone.cpp
index 64019fe..dffa578 100644
--- a/src/glsl/ir_clone.cpp
+++ b/src/glsl/ir_clone.cpp
@@ -45,9 +45,9 @@ ir_variable::clone(void *mem_ctx, struct hash_table *ht) const
var->data.max_array_access = this->data.max_array_access;
if (this->is_interface_instance()) {
- var->max_ifc_array_access =
+ var->u.max_ifc_array_access =
rzalloc_array(var, unsigned, this->interface_type->length);
- memcpy(var->max_ifc_array_access, this->max_ifc_array_access,
+ memcpy(var->u.max_ifc_array_access, this->u.max_ifc_array_access,
this->interface_type->length * sizeof(unsigned));
}