[Mesa-dev] [PATCH 03/13] nir/builder: add nir_imm_double()

Samuel Iglesias Gonsálvez siglesias at igalia.com
Tue Apr 12 08:05:12 UTC 2016


From: Connor Abbott <connor.w.abbott at intel.com>

---
 src/compiler/nir/nir_builder.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h
index 84fc9bf..5787ba8 100644
--- a/src/compiler/nir/nir_builder.h
+++ b/src/compiler/nir/nir_builder.h
@@ -116,6 +116,14 @@ nir_imm_float(nir_builder *build, float x)
 }
 
 static inline nir_ssa_def *
+nir_imm_double(nir_builder *build, double x)
+{
+   nir_const_value v = { { .f64 = {x, 0, 0, 0} } };
+   nir_ssa_def *def = nir_build_imm(build, 1, v, 64);
+   return def;
+}
+
+static inline nir_ssa_def *
 nir_imm_vec4(nir_builder *build, float x, float y, float z, float w)
 {
    nir_const_value v;
-- 
2.5.0



More information about the mesa-dev mailing list