From: Ian Romanick <ian.d.roman...@intel.com> There are a bunch of places, especially in the UBO code, where we check whether something is a matrix (or record) when we actually want to know if it a matrix or an array of matrices (ditto for records).
This will be used in later patches in this series. Signed-off-by: Ian Romanick <ian.d.roman...@intel.com> --- src/glsl/glsl_types.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h index 0b63d48..2dfa8dd 100644 --- a/src/glsl/glsl_types.h +++ b/src/glsl/glsl_types.h @@ -354,6 +354,14 @@ struct glsl_type { } /** + * Query whether or not a type is a matrix or an array of matrices + */ + bool is_matrix_or_array_of() const + { + return is_matrix() || (is_array() && fields.array->is_matrix()); + } + + /** * Query whether or not a type is a non-array numeric type */ bool is_numeric() const @@ -441,6 +449,14 @@ struct glsl_type { } /** + * Query whether or not a type is a record or an array of records + */ + bool is_record_or_array_of() const + { + return is_record() || (is_array() && fields.array->is_record()); + } + + /** * Query whether or not a type is an interface */ bool is_interface() const @@ -449,6 +465,14 @@ struct glsl_type { } /** + * Query whether or not a type is an interface or an array of interfaces + */ + bool is_interface_or_array_of() const + { + return is_interface() || (is_array() && fields.array->is_interface()); + } + + /** * Query whether or not a type is the void type singleton. */ bool is_void() const -- 1.8.1.4 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev