nir/builder: Move nir_imm_vec2 from blorp into the builder
authorKarol Herbst <kherbst@redhat.com>
Fri, 29 Mar 2019 23:53:42 +0000 (00:53 +0100)
committerKarol Herbst <kherbst@redhat.com>
Sun, 14 Apr 2019 20:25:56 +0000 (22:25 +0200)
While we're here, fix a typo which caused it to actually return a vec4
with the third and fourth components zero.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir_builder.h
src/intel/blorp/blorp_blit.c

index 01622fbb154a86f3f2afed86e6e3630d33bafa25..66a028bac97b73a152733a4b5eb14a618d7a80ba 100644 (file)
@@ -279,6 +279,18 @@ nir_imm_floatN_t(nir_builder *build, double x, unsigned bit_size)
    unreachable("unknown float immediate bit size");
 }
 
+static inline nir_ssa_def *
+nir_imm_vec2(nir_builder *build, float x, float y)
+{
+   nir_const_value v;
+
+   memset(&v, 0, sizeof(v));
+   v.f32[0] = x;
+   v.f32[1] = y;
+
+   return nir_build_imm(build, 2, 32, v);
+}
+
 static inline nir_ssa_def *
 nir_imm_vec4(nir_builder *build, float x, float y, float z, float w)
 {
index f879ec4141f31df7c3acec3bffd340ea7f1b1e75..9e964d02f36e9e1f04107f47fa14faaf315fe0fc 100644 (file)
@@ -743,18 +743,6 @@ blorp_nir_combine_samples(nir_builder *b, struct brw_blorp_blit_vars *v,
    return nir_load_var(b, color);
 }
 
-static inline nir_ssa_def *
-nir_imm_vec2(nir_builder *build, float x, float y)
-{
-   nir_const_value v;
-
-   memset(&v, 0, sizeof(v));
-   v.f32[0] = x;
-   v.f32[1] = y;
-
-   return nir_build_imm(build, 4, 32, v);
-}
-
 static nir_ssa_def *
 blorp_nir_manual_blend_bilinear(nir_builder *b, nir_ssa_def *pos,
                                 unsigned tex_samples,