diff options
-rw-r--r-- | src/compiler/glsl_types.cpp | 2 | ||||
-rw-r--r-- | src/compiler/glsl_types.h | 8 | ||||
-rw-r--r-- | src/compiler/nir_types.cpp | 2 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp index 2e84d6ea72c..ded355ee308 100644 --- a/src/compiler/glsl_types.cpp +++ b/src/compiler/glsl_types.cpp @@ -246,7 +246,7 @@ glsl_type::contains_integer() const } return false; } else { - return glsl_base_type_is_integer(this->base_type); + return this->is_integer(); } } diff --git a/src/compiler/glsl_types.h b/src/compiler/glsl_types.h index 693b0371151..e986b51d523 100644 --- a/src/compiler/glsl_types.h +++ b/src/compiler/glsl_types.h @@ -586,6 +586,14 @@ public: } /** + * Query whether or not a type is an integer. + */ + bool is_integer() const + { + return glsl_base_type_is_integer(base_type); + } + + /** * Query whether or not a type is an 32-bit integer. */ bool is_integer_32() const diff --git a/src/compiler/nir_types.cpp b/src/compiler/nir_types.cpp index 7fa1741515d..e2dfc40ff0b 100644 --- a/src/compiler/nir_types.cpp +++ b/src/compiler/nir_types.cpp @@ -355,7 +355,7 @@ glsl_type_is_boolean(const struct glsl_type *type) bool glsl_type_is_integer(const struct glsl_type *type) { - return glsl_base_type_is_integer(type->base_type); + return type->is_integer(); } bool |