[Mesa-dev] [PATCH 10/26] nir/builder: Add a helper for creating undefs
Jason Ekstrand
jason at jlekstrand.net
Fri Mar 25 23:12:24 UTC 2016
---
src/compiler/nir/nir_builder.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h
index e9c409b..3dc7c25 100644
--- a/src/compiler/nir/nir_builder.h
+++ b/src/compiler/nir/nir_builder.h
@@ -75,6 +75,20 @@ nir_builder_cf_insert(nir_builder *build, nir_cf_node *cf)
}
static inline nir_ssa_def *
+nir_ssa_undef(nir_builder *build, unsigned num_components, unsigned bit_size)
+{
+ nir_ssa_undef_instr *undef =
+ nir_ssa_undef_instr_create(build->shader, num_components);
+ undef->def.bit_size = bit_size;
+ if (!undef)
+ return NULL;
+
+ nir_instr_insert(nir_before_cf_list(&build->impl->body), &undef->instr);
+
+ return &undef->def;
+}
+
+static inline nir_ssa_def *
nir_build_imm(nir_builder *build, unsigned num_components, nir_const_value value)
{
nir_load_const_instr *load_const =
--
2.5.0.400.gff86faf
More information about the mesa-dev
mailing list