Mesa (master): nir/builder: Move nir_imm_vec2 from blorp into the builder

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Apr 14 20:26:08 UTC 2019


Module: Mesa
Branch: master
Commit: daaf777376303077f9fd4c72e602b8892fe1caaf
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=daaf777376303077f9fd4c72e602b8892fe1caaf

Author: Karol Herbst <kherbst at redhat.com>
Date:   Sat Mar 30 00:53:42 2019 +0100

nir/builder: Move nir_imm_vec2 from blorp into the builder

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 at redhat.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

---

 src/compiler/nir/nir_builder.h | 12 ++++++++++++
 src/intel/blorp/blorp_blit.c   | 12 ------------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h
index 01622fbb154..66a028bac97 100644
--- a/src/compiler/nir/nir_builder.h
+++ b/src/compiler/nir/nir_builder.h
@@ -280,6 +280,18 @@ nir_imm_floatN_t(nir_builder *build, double x, unsigned 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)
 {
    nir_const_value v;
diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c
index f879ec4141f..9e964d02f36 100644
--- a/src/intel/blorp/blorp_blit.c
+++ b/src/intel/blorp/blorp_blit.c
@@ -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,




More information about the mesa-commit mailing list