diff options
author | Ian Romanick <[email protected]> | 2014-05-14 19:47:28 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2014-09-30 13:34:42 -0700 |
commit | 5aa8d8194c4975876276a9c57cdd672978a491ad (patch) | |
tree | 700e5fdf988b1b1e0125c0ab2cc19da39e527db0 /src/glsl/ir_clone.cpp | |
parent | 21df0169028d600b17ab73795da2838e92ba9038 (diff) |
glsl: Make ir_variable::num_state_slots and ir_variable::state_slots private
Also move num_state_slots inside ir_variable_data for better packing.
The payoff for this will come in a few more patches.
No change Valgrind massif results for a trimmed apitrace of dota2.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Reviewed-by: Tapani Pälli <[email protected]>
Diffstat (limited to 'src/glsl/ir_clone.cpp')
-rw-r--r-- | src/glsl/ir_clone.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/glsl/ir_clone.cpp b/src/glsl/ir_clone.cpp index 86c0e3166d5..64019fe68ae 100644 --- a/src/glsl/ir_clone.cpp +++ b/src/glsl/ir_clone.cpp @@ -53,15 +53,10 @@ ir_variable::clone(void *mem_ctx, struct hash_table *ht) const memcpy(&var->data, &this->data, sizeof(var->data)); - var->num_state_slots = this->num_state_slots; - if (this->state_slots) { - /* FINISHME: This really wants to use something like talloc_reference, but - * FINISHME: ralloc doesn't have any similar function. - */ - var->state_slots = ralloc_array(var, ir_state_slot, - this->num_state_slots); - memcpy(var->state_slots, this->state_slots, - sizeof(this->state_slots[0]) * var->num_state_slots); + if (this->get_state_slots()) { + ir_state_slot *s = var->allocate_state_slots(this->get_num_state_slots()); + memcpy(s, this->get_state_slots(), + sizeof(s[0]) * var->get_num_state_slots()); } if (this->constant_value) |