return glsl_base_type_get_bit_size(glsl_get_base_type(t));
}
-bool glsl_type_is_boolean(const struct glsl_type *t);
-bool glsl_type_is_sampler(const struct glsl_type *t);
-bool glsl_type_is_texture(const struct glsl_type *t);
-bool glsl_type_is_image(const struct glsl_type *t);
-bool glsl_type_is_atomic_uint(const struct glsl_type *t);
-bool glsl_type_is_struct(const struct glsl_type *t);
-bool glsl_type_is_interface(const struct glsl_type *t);
-bool glsl_type_is_array(const struct glsl_type *t);
-bool glsl_type_is_cmat(const struct glsl_type *t);
-bool glsl_type_is_void(const struct glsl_type *t);
-bool glsl_type_is_subroutine(const struct glsl_type *t);
-bool glsl_type_is_error(const struct glsl_type *t);
-
-bool glsl_type_is_struct_or_ifc(const struct glsl_type *t);
+static inline bool glsl_type_is_boolean(const struct glsl_type *t) { return t->base_type == GLSL_TYPE_BOOL; }
+static inline bool glsl_type_is_sampler(const struct glsl_type *t) { return t->base_type == GLSL_TYPE_SAMPLER; }
+static inline bool glsl_type_is_texture(const struct glsl_type *t) { return t->base_type == GLSL_TYPE_TEXTURE; }
+static inline bool glsl_type_is_image(const struct glsl_type *t) { return t->base_type == GLSL_TYPE_IMAGE; }
+static inline bool glsl_type_is_atomic_uint(const struct glsl_type *t) { return t->base_type == GLSL_TYPE_ATOMIC_UINT; }
+static inline bool glsl_type_is_struct(const struct glsl_type *t) { return t->base_type == GLSL_TYPE_STRUCT; }
+static inline bool glsl_type_is_interface(const struct glsl_type *t) { return t->base_type == GLSL_TYPE_INTERFACE; }
+static inline bool glsl_type_is_array(const struct glsl_type *t) { return t->base_type == GLSL_TYPE_ARRAY; }
+static inline bool glsl_type_is_cmat(const struct glsl_type *t) { return t->base_type == GLSL_TYPE_COOPERATIVE_MATRIX; }
+static inline bool glsl_type_is_void(const struct glsl_type *t) { return t->base_type == GLSL_TYPE_VOID; }
+static inline bool glsl_type_is_subroutine(const struct glsl_type *t) { return t->base_type == GLSL_TYPE_SUBROUTINE; }
+static inline bool glsl_type_is_error(const struct glsl_type *t) { return t->base_type == GLSL_TYPE_ERROR; }
+
+static inline bool
+glsl_type_is_struct_or_ifc(const struct glsl_type *t)
+{
+ return glsl_type_is_struct(t) || glsl_type_is_interface(t);
+}
+
bool glsl_type_is_packed(const struct glsl_type *t);
bool glsl_type_is_16bit(const struct glsl_type *t);
bool glsl_type_is_32bit(const struct glsl_type *t);
#include "compiler/builtin_types_cpp.h"
#undef BUILTIN_TYPES_CPP_DEFINITIONS
-inline bool glsl_type::is_boolean() const { return base_type == GLSL_TYPE_BOOL; }
-inline bool glsl_type::is_sampler() const { return base_type == GLSL_TYPE_SAMPLER; }
-inline bool glsl_type::is_texture() const { return base_type == GLSL_TYPE_TEXTURE; }
-inline bool glsl_type::is_image() const { return base_type == GLSL_TYPE_IMAGE; }
-inline bool glsl_type::is_array() const { return base_type == GLSL_TYPE_ARRAY; }
-inline bool glsl_type::is_struct() const { return base_type == GLSL_TYPE_STRUCT; }
-inline bool glsl_type::is_interface() const { return base_type == GLSL_TYPE_INTERFACE; }
-inline bool glsl_type::is_cmat() const { return base_type == GLSL_TYPE_COOPERATIVE_MATRIX; }
-inline bool glsl_type::is_void() const { return base_type == GLSL_TYPE_VOID; }
-inline bool glsl_type::is_error() const { return base_type == GLSL_TYPE_ERROR; }
-inline bool glsl_type::is_subroutine() const { return base_type == GLSL_TYPE_SUBROUTINE; }
-inline bool glsl_type::is_atomic_uint() const { return base_type == GLSL_TYPE_ATOMIC_UINT; }
-
+inline bool glsl_type::is_boolean() const { return glsl_type_is_boolean(this); }
+inline bool glsl_type::is_sampler() const { return glsl_type_is_sampler(this); }
+inline bool glsl_type::is_texture() const { return glsl_type_is_texture(this); }
+inline bool glsl_type::is_image() const { return glsl_type_is_image(this); }
+inline bool glsl_type::is_array() const { return glsl_type_is_array(this); }
+inline bool glsl_type::is_struct() const { return glsl_type_is_struct(this); }
+inline bool glsl_type::is_interface() const { return glsl_type_is_interface(this); }
+inline bool glsl_type::is_cmat() const { return glsl_type_is_cmat(this); }
+inline bool glsl_type::is_void() const { return glsl_type_is_void(this); }
+inline bool glsl_type::is_error() const { return glsl_type_is_error(this); }
+inline bool glsl_type::is_subroutine() const { return glsl_type_is_subroutine(this); }
+inline bool glsl_type::is_atomic_uint() const { return glsl_type_is_atomic_uint(this); }
inline bool
glsl_type::is_scalar() const
}
bool
-glsl_type_is_void(const struct glsl_type *type)
-{
- return type->is_void();
-}
-
-bool
-glsl_type_is_error(const struct glsl_type *type)
-{
- return type->is_error();
-}
-
-bool
glsl_type_is_vector(const struct glsl_type *type)
{
return type->is_vector();
}
bool
-glsl_type_is_array(const struct glsl_type *type)
-{
- return type->is_array();
-}
-
-bool
glsl_type_is_unsized_array(const struct glsl_type *type)
{
return type->is_unsized_array();
}
bool
-glsl_type_is_cmat(const struct glsl_type *type)
-{
- return type->is_cmat();
-}
-
-bool
-glsl_type_is_struct(const struct glsl_type *type)
-{
- return type->is_struct();
-}
-
-bool
-glsl_type_is_interface(const struct glsl_type *type)
-{
- return type->is_interface();
-}
-
-bool
-glsl_type_is_struct_or_ifc(const struct glsl_type *type)
-{
- return type->is_struct() || type->is_interface();
-}
-
-bool
-glsl_type_is_sampler(const struct glsl_type *type)
-{
- return type->is_sampler();
-}
-
-bool
glsl_type_is_bare_sampler(const struct glsl_type *type)
{
return type->is_sampler() && type->sampled_type == GLSL_TYPE_VOID;
}
bool
-glsl_type_is_texture(const struct glsl_type *type)
-{
- return type->is_texture();
-}
-
-bool
-glsl_type_is_image(const struct glsl_type *type)
-{
- return type->is_image();
-}
-
-bool
glsl_sampler_type_is_shadow(const struct glsl_type *type)
{
assert(glsl_type_is_sampler(type));
}
bool
-glsl_type_is_boolean(const struct glsl_type *type)
-{
- return type->is_boolean();
-}
-bool
glsl_type_is_integer(const struct glsl_type *type)
{
return type->is_integer();