diff options
Diffstat (limited to 'glsl_types.h')
-rw-r--r-- | glsl_types.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/glsl_types.h b/glsl_types.h index 0375934de9..2b660168bd 100644 --- a/glsl_types.h +++ b/glsl_types.h @@ -145,13 +145,18 @@ struct glsl_type { && (base_type >= GLSL_TYPE_UINT) && (base_type <= GLSL_TYPE_BOOL); } -}; -#define is_glsl_type_vector(t) \ - (((t)->vector_elements > 0) \ - && ((t)->matrix_rows == 0) \ - && ((t)->base_type >= GLSL_TYPE_UINT) \ - && ((t)->base_type <= GLSL_TYPE_BOOL)) + /** + * Query whether or not a type is a vector + */ + bool is_vector() const + { + return (vector_elements > 0) + && (matrix_rows == 0) + && (base_type >= GLSL_TYPE_UINT) + && (base_type <= GLSL_TYPE_BOOL); + } +}; #define is_glsl_type_matrix(t) \ (((t)->matrix_rows > 0) \ |