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.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.cpp')
-rw-r--r-- | src/glsl/ir.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp index fa1d85a5026..3a40926e911 100644 --- a/src/glsl/ir.cpp +++ b/src/glsl/ir.cpp @@ -1855,6 +1855,7 @@ static void steal_memory(ir_instruction *ir, void *new_ctx) { ir_variable *var = ir->as_variable(); + ir_function *fn = ir->as_function(); ir_constant *constant = ir->as_constant(); if (var != NULL && var->constant_value != NULL) steal_memory(var->constant_value, ir); @@ -1862,6 +1863,9 @@ steal_memory(ir_instruction *ir, void *new_ctx) if (var != NULL && var->constant_initializer != NULL) steal_memory(var->constant_initializer, ir); + if (fn != NULL && fn->subroutine_types) + ralloc_steal(new_ctx, fn->subroutine_types); + /* The components of aggregate constants are not visited by the normal * visitor, so steal their values by hand. */ |