diff options
author | Eric Anholt <[email protected]> | 2015-01-20 16:23:51 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2015-01-22 13:52:19 -0800 |
commit | 534a4ec82f09fa37e2134c994082e71c79b7d5ec (patch) | |
tree | 598ab6b45e9a47d997c7d09881a6bad54c805d45 /src/glsl/nir/nir_search.c | |
parent | c5be9c126d6ca9380cd381a5eb22554e4bb71a64 (diff) |
nir: Make an easier helper for setting up SSA defs.
Almost all instructions we nir_ssa_def_init() for are nir_dests, and you
have to keep from forgetting to set is_ssa when you do. Just provide the
simpler helper, instead.
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir_search.c')
-rw-r--r-- | src/glsl/nir/nir_search.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/glsl/nir/nir_search.c b/src/glsl/nir/nir_search.c index e69fdfd431c..7ef22e89ab5 100644 --- a/src/glsl/nir/nir_search.c +++ b/src/glsl/nir/nir_search.c @@ -201,8 +201,7 @@ construct_value(const nir_search_value *value, nir_alu_type type, num_components = nir_op_infos[expr->opcode].output_size; nir_alu_instr *alu = nir_alu_instr_create(mem_ctx, expr->opcode); - alu->dest.dest.is_ssa = true; - nir_ssa_def_init(&alu->instr, &alu->dest.dest.ssa, num_components, NULL); + nir_ssa_dest_init(&alu->instr, &alu->dest.dest, num_components, NULL); alu->dest.write_mask = (1 << num_components) - 1; alu->dest.saturate = false; @@ -301,9 +300,8 @@ nir_replace_instr(nir_alu_instr *instr, const nir_search_expression *search, */ nir_alu_instr *mov = nir_alu_instr_create(mem_ctx, nir_op_imov); mov->dest.write_mask = instr->dest.write_mask; - mov->dest.dest.is_ssa = true; - nir_ssa_def_init(&mov->instr, &mov->dest.dest.ssa, - instr->dest.dest.ssa.num_components, NULL); + nir_ssa_dest_init(&mov->instr, &mov->dest.dest, + instr->dest.dest.ssa.num_components, NULL); mov->src[0] = construct_value(replace, nir_op_infos[instr->op].output_type, instr->dest.dest.ssa.num_components, &state, |