glsl: add glsl_base_type_is_integer
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Sat, 24 Jun 2017 11:34:27 +0000 (13:34 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 5 Jul 2017 10:27:10 +0000 (12:27 +0200)
We will use this from radeonsi/nir, which we want to keep as pure C code.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/compiler/glsl_types.h

index 55faac25331401499c50395985b58a8bf2033a18..2857dc9ad988ac2b6513eb554e8f03451b0703a3 100644 (file)
@@ -77,6 +77,17 @@ static inline bool glsl_base_type_is_64bit(enum glsl_base_type type)
           type == GLSL_TYPE_SAMPLER;
 }
 
+static inline bool glsl_base_type_is_integer(enum glsl_base_type type)
+{
+   return type == GLSL_TYPE_UINT ||
+          type == GLSL_TYPE_INT ||
+          type == GLSL_TYPE_UINT64 ||
+          type == GLSL_TYPE_INT64 ||
+          type == GLSL_TYPE_BOOL ||
+          type == GLSL_TYPE_SAMPLER ||
+          type == GLSL_TYPE_IMAGE;
+}
+
 enum glsl_sampler_dim {
    GLSL_SAMPLER_DIM_1D = 0,
    GLSL_SAMPLER_DIM_2D,