[Mesa-dev] [PATCH 2/9] nir: Free dead variables when removing them.

Kenneth Graunke kenneth at whitecape.org
Sat Mar 28 14:28:25 PDT 2015


Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/glsl/nir/nir_remove_dead_variables.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/glsl/nir/nir_remove_dead_variables.c b/src/glsl/nir/nir_remove_dead_variables.c
index baa321e..4417e2a 100644
--- a/src/glsl/nir/nir_remove_dead_variables.c
+++ b/src/glsl/nir/nir_remove_dead_variables.c
@@ -102,8 +102,10 @@ remove_dead_vars(struct exec_list *var_list, struct set *live)
 {
    foreach_list_typed_safe(nir_variable, var, node, var_list) {
       struct set_entry *entry = _mesa_set_search(live, var);
-      if (entry == NULL)
+      if (entry == NULL) {
          exec_node_remove(&var->node);
+         ralloc_free(var);
+      }
    }
 }
 
-- 
2.3.4



More information about the mesa-dev mailing list