From 7aeb6abda7da155d81fc4bda5c0c03ff28e5ed0c Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 23 Mar 2010 17:31:03 -0700 Subject: [PATCH] Add glsl_type::is_numeric and glsl_type::is_boolean queries --- glsl_types.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/glsl_types.h b/glsl_types.h index b1cd9a9d637..7c48e792eb5 100644 --- 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 */ -- 2.30.2