summaryrefslogtreecommitdiff
path: root/glsl_types.h
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-03-23 12:28:28 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-03-23 12:28:28 -0700
commit8400bc4d35fe7aa0ce605e4f4bb837227dfcacf9 (patch)
tree1bbfbc11655c9dc2eb72ab17b20318258f70ca00 /glsl_types.h
parent9e7c34b865309c65ea5a763900e2d0eae4b58ce5 (diff)
Add is_error and is_void type queries
Diffstat (limited to 'glsl_types.h')
-rw-r--r--glsl_types.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/glsl_types.h b/glsl_types.h
index 45037b3..57f339a 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 {