From 8400bc4d35fe7aa0ce605e4f4bb837227dfcacf9 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 23 Mar 2010 12:28:28 -0700 Subject: [PATCH] Add is_error and is_void type queries --- glsl_types.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/glsl_types.h b/glsl_types.h index 45037b37869..57f339a9a6f 100644 --- a/glsl_types.h +++ b/glsl_types.h @@ -166,6 +166,22 @@ struct glsl_type { /* GLSL only has float matrices. */ return (matrix_rows > 0) && (base_type == GLSL_TYPE_FLOAT); } + + /** + * Query whether or not a type is the void type singleton. + */ + bool is_void() const + { + return base_type == GLSL_TYPE_VOID; + } + + /** + * Query whether or not a type is the error type singleton. + */ + bool is_error() const + { + return base_type == GLSL_TYPE_ERROR; + } }; struct glsl_struct_field { -- 2.30.2