[Mesa-dev] [PATCH] nir/vars_to_ssa: Don't build deref nodes for non-local variables

Jason Ekstrand jason at jlekstrand.net
Mon Jul 9 04:55:48 UTC 2018


---
 src/compiler/nir/nir_lower_vars_to_ssa.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/compiler/nir/nir_lower_vars_to_ssa.c b/src/compiler/nir/nir_lower_vars_to_ssa.c
index 3f37acaed33..ef2019551c6 100644
--- a/src/compiler/nir/nir_lower_vars_to_ssa.c
+++ b/src/compiler/nir/nir_lower_vars_to_ssa.c
@@ -206,6 +206,12 @@ get_deref_node_recur(nir_deref_instr *deref,
 static struct deref_node *
 get_deref_node(nir_deref_instr *deref, struct lower_variables_state *state)
 {
+   /* This pass only works on local variables.  Just ignore any derefs with
+    * a non-local mode.
+    */
+   if (deref->mode != nir_var_local)
+      return NULL;
+
    struct deref_node *node = get_deref_node_recur(deref, state);
    if (!node)
       return NULL;
-- 
2.17.1



More information about the mesa-dev mailing list