From 534a4ec82f09fa37e2134c994082e71c79b7d5ec Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 20 Jan 2015 16:23:51 -0800 Subject: 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 --- src/glsl/nir/nir.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/glsl/nir/nir.c') diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index 89e21fddeb9..16ad2da945c 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -1791,6 +1791,14 @@ nir_ssa_def_init(nir_instr *instr, nir_ssa_def *def, } } +void +nir_ssa_dest_init(nir_instr *instr, nir_dest *dest, + unsigned num_components, const char *name) +{ + dest->is_ssa = true; + nir_ssa_def_init(instr, &dest->ssa, num_components, name); +} + struct ssa_def_rewrite_state { void *mem_ctx; nir_ssa_def *old; -- cgit v1.2.3