summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-03-26 14:38:37 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-03-26 14:38:37 -0700
commit40176e249f72b6090204611873b19aed3da67c71 (patch)
tree0100593336189bad8f5b5a8ca6766a1a9f11d964
parent0471e8b0896e05b3bc81ccad6184e6e35fb61425 (diff)
Replace is_integer_base_type macro with glsl_type::is_integer method
-rw-r--r--ast_to_hir.cpp3
-rw-r--r--glsl_types.h11
2 files changed, 9 insertions, 5 deletions
diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp
index 40a980f682..890dc8e465 100644
--- a/ast_to_hir.cpp
+++ b/ast_to_hir.cpp
@@ -255,8 +255,7 @@ modulus_result_type(const struct glsl_type *type_a,
* integer vectors. The operand types must both be signed or both be
* unsigned."
*/
- if (! is_integer_base_type(type_a->base_type)
- || ! is_integer_base_type(type_b->base_type)
+ if (!type_a->is_integer() || !type_b->is_integer()
|| (type_a->base_type != type_b->base_type)) {
return glsl_type::error_type;
}
diff --git a/glsl_types.h b/glsl_types.h
index e05130102a..9af8e9d3f8 100644
--- a/glsl_types.h
+++ b/glsl_types.h
@@ -42,9 +42,6 @@
#define is_numeric_base_type(b) \
(((b) >= GLSL_TYPE_UINT) && ((b) <= GLSL_TYPE_FLOAT))
-#define is_integer_base_type(b) \
- (((b) == GLSL_TYPE_UINT) || ((b) == GLSL_TYPE_INT))
-
#define is_error_type(t) ((t)->base_type == GLSL_TYPE_ERROR)
enum glsl_sampler_dim {
@@ -204,6 +201,14 @@ struct glsl_type {
}
/**
+ * Query whether or not a type is an integral type
+ */
+ bool is_integer() const
+ {
+ return (base_type == GLSL_TYPE_UINT) || (base_type == GLSL_TYPE_INT);
+ }
+
+ /**
* Query whether or not a type is a non-array boolean type
*/
bool is_boolean() const