glsl: free hash tables earlier
authorTimothy Arceri <timothy.arceri@collabora.com>
Tue, 26 Jul 2016 23:52:04 +0000 (09:52 +1000)
committerTimothy Arceri <timothy.arceri@collabora.com>
Wed, 27 Jul 2016 22:05:04 +0000 (08:05 +1000)
These are only used by get_matching_input() which has been call
at this point so free the hash tables.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/compiler/glsl/link_varyings.cpp

index f6778b6a8554fb5047333173a32d5bfa5ba7b647..b4799d297dc68f4c7c4b4a2eea716041472fdf49 100644 (file)
@@ -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) {