summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorConnor Abbott <[email protected]>2015-07-31 10:52:04 -0700
committerSamuel Iglesias Gonsálvez <[email protected]>2016-04-28 11:58:13 +0200
commit2cf3b28884047f1cdef76542355bd2a4dd653fde (patch)
tree57391d51f22a15c6cd8df398c07e50a14a548087 /src
parent3a150683ce2f1245fc6f5a02f4a1c2197353962c (diff)
nir/builder: add nir_imm_double()
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/compiler/nir/nir_builder.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h
index 3e3bdcd3b8d..a14f9ef70d3 100644
--- a/src/compiler/nir/nir_builder.h
+++ b/src/compiler/nir/nir_builder.h
@@ -115,6 +115,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, 64, v);
+ 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;