summaryrefslogtreecommitdiff
path: root/glsl_types.h
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-03-23 17:31:03 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-03-23 17:31:03 -0700
commit7aeb6abda7da155d81fc4bda5c0c03ff28e5ed0c (patch)
treee8be7ced4b9f9665e329e844c246e1d7f3a7f108 /glsl_types.h
parentabef9557642f77d406452f3c32e5e49ced212571 (diff)
Add glsl_type::is_numeric and glsl_type::is_boolean queries
Diffstat (limited to 'glsl_types.h')
-rw-r--r--glsl_types.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/glsl_types.h b/glsl_types.h
index b1cd9a9..7c48e79 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