[Mesa-dev] [PATCH 01/92] glsl: add glsl_base_type_is_integer

Nicolai Hähnle nhaehnle at gmail.com
Mon Jun 26 14:09:40 UTC 2017


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

We will use this from radeonsi/nir, which we want to keep as pure C code.
---
 src/compiler/glsl_types.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/compiler/glsl_types.h b/src/compiler/glsl_types.h
index 55faac2..2857dc9 100644
--- a/src/compiler/glsl_types.h
+++ b/src/compiler/glsl_types.h
@@ -70,20 +70,31 @@ enum glsl_base_type {
 
 static inline bool glsl_base_type_is_64bit(enum glsl_base_type type)
 {
    return type == GLSL_TYPE_DOUBLE ||
           type == GLSL_TYPE_UINT64 ||
           type == GLSL_TYPE_INT64  ||
           type == GLSL_TYPE_IMAGE  ||
           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,
    GLSL_SAMPLER_DIM_3D,
    GLSL_SAMPLER_DIM_CUBE,
    GLSL_SAMPLER_DIM_RECT,
    GLSL_SAMPLER_DIM_BUF,
    GLSL_SAMPLER_DIM_EXTERNAL,
    GLSL_SAMPLER_DIM_MS,
    GLSL_SAMPLER_DIM_SUBPASS, /* for vulkan input attachments */
-- 
2.9.3



More information about the mesa-dev mailing list