summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2015-01-20 16:23:51 -0800
committerEric Anholt <[email protected]>2015-01-22 13:52:19 -0800
commit534a4ec82f09fa37e2134c994082e71c79b7d5ec (patch)
tree598ab6b45e9a47d997c7d09881a6bad54c805d45 /src/glsl/nir/nir.c
parentc5be9c126d6ca9380cd381a5eb22554e4bb71a64 (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.c')
-rw-r--r--src/glsl/nir/nir.c8
1 files changed, 8 insertions, 0 deletions
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;