[Mesa-dev] [PATCH 13/13] glsl: free hash tables earlier

Timothy Arceri timothy.arceri at collabora.com
Wed Jul 27 05:20:54 UTC 2016


These are only used by get_matching_input() which has been call
at this point so free the hash tables.
---
 src/compiler/glsl/link_varyings.cpp | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp
index d48c680..91d8974 100644
--- a/src/compiler/glsl/link_varyings.cpp
+++ b/src/compiler/glsl/link_varyings.cpp
@@ -2156,6 +2156,9 @@ assign_varying_locations(struct gl_context *ctx,
       }
    }
 
+   hash_table_dtor(consumer_inputs);
+   hash_table_dtor(consumer_interface_inputs);
+
    for (unsigned i = 0; i < num_tfeedback_decls; ++i) {
       if (!tfeedback_decls[i].is_varying())
          continue;
@@ -2165,8 +2168,6 @@ assign_varying_locations(struct gl_context *ctx,
 
       if (matched_candidate == NULL) {
          hash_table_dtor(tfeedback_candidates);
-         hash_table_dtor(consumer_inputs);
-         hash_table_dtor(consumer_interface_inputs);
          return false;
       }
 
@@ -2185,15 +2186,10 @@ assign_varying_locations(struct gl_context *ctx,
 
       if (!tfeedback_decls[i].assign_location(ctx, prog)) {
          hash_table_dtor(tfeedback_candidates);
-         hash_table_dtor(consumer_inputs);
-         hash_table_dtor(consumer_interface_inputs);
          return false;
       }
    }
-
    hash_table_dtor(tfeedback_candidates);
-   hash_table_dtor(consumer_inputs);
-   hash_table_dtor(consumer_interface_inputs);
 
    if (consumer && producer) {
       foreach_in_list(ir_instruction, node, consumer->ir) {
-- 
2.7.4



More information about the mesa-dev mailing list