diff options
author | Eduardo Lima Mitev <[email protected]> | 2017-03-05 20:28:42 +0100 |
---|---|---|
committer | Neil Roberts <[email protected]> | 2017-10-30 18:10:39 +0100 |
commit | f5fe99ac85e15b705612bd9e7599cc974c2a121b (patch) | |
tree | b139f026c3dbc034d1b7422b2cfc60f622238847 /src/compiler/glsl/linker.cpp | |
parent | 4c62a270a99d443316e29020377465a90a6968c0 (diff) |
glsl: Use the utility function to copy symbols between symbol tables
This effectively factorizes a couple of similar routines.
v2 (Neil Roberts): Non-trivial rebase on master
Reviewed-by: Kenneth Graunke <[email protected]>
Signed-off-by: Eduardo Lima Mitev <[email protected]>
Signed-off-by: Neil Roberts <[email protected]>
Diffstat (limited to 'src/compiler/glsl/linker.cpp')
-rw-r--r-- | src/compiler/glsl/linker.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index f827b68555f..004529157ee 100644 --- a/src/compiler/glsl/linker.cpp +++ b/src/compiler/glsl/linker.cpp @@ -1255,21 +1255,11 @@ interstage_cross_validate_uniform_blocks(struct gl_shader_program *prog, * Populates a shaders symbol table with all global declarations */ static void -populate_symbol_table(gl_linked_shader *sh) +populate_symbol_table(gl_linked_shader *sh, glsl_symbol_table *symbols) { sh->symbols = new(sh) glsl_symbol_table; - foreach_in_list(ir_instruction, inst, sh->ir) { - ir_variable *var; - ir_function *func; - - if ((func = inst->as_function()) != NULL) { - sh->symbols->add_function(func); - } else if ((var = inst->as_variable()) != NULL) { - if (var->data.mode != ir_var_temporary) - sh->symbols->add_variable(var); - } - } + _mesa_glsl_copy_symbols_from_table(sh->ir, symbols, sh->symbols); } @@ -2288,7 +2278,7 @@ link_intrastage_shaders(void *mem_ctx, link_bindless_layout_qualifiers(prog, shader_list, num_shaders); - populate_symbol_table(linked); + populate_symbol_table(linked, shader_list[0]->symbols); /* The pointer to the main function in the final linked shader (i.e., the * copy of the original shader that contained the main function). |