Mesa (master): nir/types: Add an is_vector_or_scalar helper

Jason Ekstrand jekstrand at kemper.freedesktop.org
Sat Nov 7 20:09:25 UTC 2015


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

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Fri May  1 11:26:40 2015 -0700

nir/types: Add an is_vector_or_scalar helper

---

 src/glsl/nir/nir_types.cpp |    6 ++++++
 src/glsl/nir/nir_types.h   |    1 +
 2 files changed, 7 insertions(+)

diff --git a/src/glsl/nir/nir_types.cpp b/src/glsl/nir/nir_types.cpp
index 965f423..135591a 100644
--- a/src/glsl/nir/nir_types.cpp
+++ b/src/glsl/nir/nir_types.cpp
@@ -144,6 +144,12 @@ glsl_type_is_scalar(const struct glsl_type *type)
 }
 
 bool
+glsl_type_is_vector_or_scalar(const struct glsl_type *type)
+{
+   return type->is_vector() || type->is_scalar();
+}
+
+bool
 glsl_type_is_matrix(const struct glsl_type *type)
 {
    return type->is_matrix();
diff --git a/src/glsl/nir/nir_types.h b/src/glsl/nir/nir_types.h
index 60d561b..b0b5184 100644
--- a/src/glsl/nir/nir_types.h
+++ b/src/glsl/nir/nir_types.h
@@ -70,6 +70,7 @@ unsigned glsl_get_record_location_offset(const struct glsl_type *type,
 bool glsl_type_is_void(const struct glsl_type *type);
 bool glsl_type_is_vector(const struct glsl_type *type);
 bool glsl_type_is_scalar(const struct glsl_type *type);
+bool glsl_type_is_vector_or_scalar(const struct glsl_type *type);
 bool glsl_type_is_matrix(const struct glsl_type *type);
 
 const struct glsl_type *glsl_void_type(void);




More information about the mesa-commit mailing list