summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-05-01 11:26:40 -0700
committerJason Ekstrand <[email protected]>2015-11-07 12:09:38 -0800
commit7d90e570f311066d1fd1eaafe681a8c939c86bae (patch)
tree675f519183ff8708599485175f30f0644156acff /src
parentd43e16b1638cdadc7fcff2007b106e2a559dae7d (diff)
nir/types: Add an is_vector_or_scalar helper
Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/glsl/nir/nir_types.cpp6
-rw-r--r--src/glsl/nir/nir_types.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/glsl/nir/nir_types.cpp b/src/glsl/nir/nir_types.cpp
index 965f42320be..135591ab97d 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 60d561b25ee..b0b51842a43 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);