diff options
author | Dave Airlie <[email protected]> | 2015-04-20 10:22:57 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2015-07-23 17:25:32 +1000 |
commit | 30681c3bb80ad78392f1740aa915efa072c837e8 (patch) | |
tree | 7de576f29799ea7e571ad904332c619d34e872dc /src/glsl/ir_clone.cpp | |
parent | d8a250ce5edc3da092ede6d62d433fbb37aa6cf6 (diff) |
glsl/ir: add subroutine information storage to ir_function (v1.1)
We need to store two sets of info into the ir_function,
if this is a function definition with a subroutine list
(subroutine_def) or if it a subroutine prototype.
v1.1: add some more documentation.
Reviewed-by: Chris Forbes <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/glsl/ir_clone.cpp')
-rw-r--r-- | src/glsl/ir_clone.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/glsl/ir_clone.cpp b/src/glsl/ir_clone.cpp index 49834ffbabf..a8fac183a8d 100644 --- a/src/glsl/ir_clone.cpp +++ b/src/glsl/ir_clone.cpp @@ -267,6 +267,12 @@ ir_function::clone(void *mem_ctx, struct hash_table *ht) const { ir_function *copy = new(mem_ctx) ir_function(this->name); + copy->is_subroutine = this->is_subroutine; + copy->num_subroutine_types = this->num_subroutine_types; + copy->subroutine_types = ralloc_array(mem_ctx, const struct glsl_type *, copy->num_subroutine_types); + for (int i = 0; i < copy->num_subroutine_types; i++) + copy->subroutine_types[i] = this->subroutine_types[i]; + foreach_in_list(const ir_function_signature, sig, &this->signatures) { ir_function_signature *sig_copy = sig->clone(mem_ctx, ht); copy->add_signature(sig_copy); |