Mesa (main): nir: add imm_vec3 to round these out

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Aug 9 15:18:33 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Fri Aug  6 14:47:37 2021 -0400

nir: add imm_vec3 to round these out

Acked-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12253>

---

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

diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h
index 48ba1bcdfdb..e778f0e73c8 100644
--- a/src/compiler/nir/nir_builder.h
+++ b/src/compiler/nir/nir_builder.h
@@ -352,6 +352,17 @@ nir_imm_vec2(nir_builder *build, float x, float y)
    return nir_build_imm(build, 2, 32, v);
 }
 
+static inline nir_ssa_def *
+nir_imm_vec3(nir_builder *build, float x, float y, float z)
+{
+   nir_const_value v[3] = {
+      nir_const_value_for_float(x, 32),
+      nir_const_value_for_float(y, 32),
+      nir_const_value_for_float(z, 32),
+   };
+   return nir_build_imm(build, 3, 32, v);
+}
+
 static inline nir_ssa_def *
 nir_imm_vec4(nir_builder *build, float x, float y, float z, float w)
 {



More information about the mesa-commit mailing list