From 70348543ac8f2c4d3d25996869461c53ea82b6a8 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 29 Mar 2010 16:17:15 -0700 Subject: [PATCH] Add glsl_type::is_array and glsl_type::is_float queries --- glsl_types.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/glsl_types.h b/glsl_types.h index 68a32efde66..bb2d6f697b6 100644 --- a/glsl_types.h +++ b/glsl_types.h @@ -223,6 +223,14 @@ struct glsl_type { return (base_type == GLSL_TYPE_UINT) || (base_type == GLSL_TYPE_INT); } + /** + * Query whether or not a type is a float type + */ + bool is_float() const + { + return base_type == GLSL_TYPE_FLOAT; + } + /** * Query whether or not a type is a non-array boolean type */ @@ -239,6 +247,14 @@ struct glsl_type { return base_type == GLSL_TYPE_SAMPLER; } + /** + * Query whether or not a type is an array + */ + bool is_array() const + { + return base_type == GLSL_TYPE_ARRAY; + } + /** * Query whether or not a type is the void type singleton. */ -- 2.30.2