[Mesa-dev] [PATCH 1/3] nir/search: Use nir_alu_src_copy

Jason Ekstrand jason at jlekstrand.net
Fri Jan 23 22:04:39 PST 2015


Before we were doing this confusing thing where we copied structures and
then did a nir_src_copy in case there was an indirect.  Now, we just call
the new nir_alu_src_copy function instead.
---
 src/glsl/nir/nir_search.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/glsl/nir/nir_search.c b/src/glsl/nir/nir_search.c
index 7ef22e8..18e0330 100644
--- a/src/glsl/nir/nir_search.c
+++ b/src/glsl/nir/nir_search.c
@@ -233,8 +233,8 @@ construct_value(const nir_search_value *value, nir_alu_type type,
       const nir_search_variable *var = nir_search_value_as_variable(value);
       assert(state->variables_seen & (1 << var->variable));
 
-      nir_alu_src val = state->variables[var->variable];
-      val.src = nir_src_copy(val.src, mem_ctx);
+      nir_alu_src val;
+      nir_alu_src_copy(&val, &state->variables[var->variable], mem_ctx);
 
       return val;
    }
-- 
2.2.1



More information about the mesa-dev mailing list