From 198d4a535b9f090f05137d335d3676f3cae1fc1f Mon Sep 17 00:00:00 2001 From: "Kristian H. Kristensen" Date: Wed, 4 Mar 2020 13:57:33 -0800 Subject: [PATCH] glsl: Add type queries for fp16+float and fp16+float+double Following the is_integer_32_64() convention, add is_float_16_32() and float_16_32_64() for these commonly tested combinations. Part-of: --- src/compiler/glsl_types.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/compiler/glsl_types.h b/src/compiler/glsl_types.h index 9b64427df67..f709bdd702e 100644 --- a/src/compiler/glsl_types.h +++ b/src/compiler/glsl_types.h @@ -761,6 +761,22 @@ public: return base_type == GLSL_TYPE_FLOAT; } + /** + * Query whether or not a type is a half-float or float type + */ + bool is_float_16_32() const + { + return base_type == GLSL_TYPE_FLOAT16 || is_float(); + } + + /** + * Query whether or not a type is a half-float, float or double + */ + bool is_float_16_32_64() const + { + return base_type == GLSL_TYPE_FLOAT16 || is_float() || is_double(); + } + /** * Query whether or not a type is a double type */ -- 2.30.2