projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
abef955
)
Add glsl_type::is_numeric and glsl_type::is_boolean queries
author
Ian Romanick
<ian.d.romanick@intel.com>
Wed, 24 Mar 2010 00:31:03 +0000
(17:31 -0700)
committer
Ian Romanick
<ian.d.romanick@intel.com>
Wed, 24 Mar 2010 00:31:03 +0000
(17:31 -0700)
glsl_types.h
patch
|
blob
|
history
diff --git
a/glsl_types.h
b/glsl_types.h
index b1cd9a9d637117b391ea816dc1c874046bb35812..7c48e792eb5a53587a4de589205891c7026ffffb 100644
(file)
--- a/
glsl_types.h
+++ b/
glsl_types.h
@@
-167,6
+167,22
@@
struct glsl_type {
return (matrix_rows > 0) && (base_type == GLSL_TYPE_FLOAT);
}
+ /**
+ * 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
*/