From: Kristian H. Kristensen Date: Wed, 4 Mar 2020 21:57:33 +0000 (-0800) Subject: glsl: Add type queries for fp16+float and fp16+float+double X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=198d4a535b9f090f05137d335d3676f3cae1fc1f;p=mesa.git 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: --- 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 */