summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--glsl_types.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/glsl_types.h b/glsl_types.h
index b1cd9a9d63..7c48e792eb 100644
--- a/glsl_types.h
+++ b/glsl_types.h
@@ -168,6 +168,22 @@ struct glsl_type {
}
/**
+ * Query whether or not a type is a non-array numeric type
+ */
+ bool is_numeric() const
+ {
+ return (base_type >= GLSL_TYPE_UINT) && (base_type <= GLSL_TYPE_FLOAT);
+ }
+
+ /**
+ * Query whether or not a type is a non-array boolean type
+ */
+ bool is_boolean() const
+ {
+ return base_type == GLSL_TYPE_BOOL;
+ }
+
+ /**
* Query whether or not a type is a sampler
*/
bool is_sampler() const