nir: Use pointers for nir_src_copy and nir_dest_copy

This avoids the overhead of copying structures and better matches the newly
added nir_alu_src_copy and nir_alu_dest_copy.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
This commit is contained in:
Jason Ekstrand
2015-01-23 16:57:40 -08:00
parent 9f5fee8804
commit 27c6e3e4ca
10 changed files with 47 additions and 53 deletions

View File

@@ -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;
}