return type->arrays_of_arrays_size();
}
+unsigned
+glsl_count_attribute_slots(const struct glsl_type *type,
+ bool vertex_input_slots)
+{
+ return type->count_attribute_slots(vertex_input_slots);
+}
+
const char *
glsl_get_struct_elem_name(const struct glsl_type *type, unsigned index)
{
glsl_sampler_dim
glsl_get_sampler_dim(const struct glsl_type *type)
{
- assert(glsl_type_is_sampler(type));
+ assert(glsl_type_is_sampler(type) || glsl_type_is_image(type));
return (glsl_sampler_dim)type->sampler_dimensionality;
}
glsl_base_type
glsl_get_sampler_result_type(const struct glsl_type *type)
{
- assert(glsl_type_is_sampler(type));
+ assert(glsl_type_is_sampler(type) || glsl_type_is_image(type));
return (glsl_base_type)type->sampler_type;
}
return type->is_void();
}
+bool
+glsl_type_is_error(const glsl_type *type)
+{
+ return type->is_error();
+}
+
bool
glsl_type_is_vector(const struct glsl_type *type)
{
return type->is_sampler();
}
+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)
{
bool
glsl_sampler_type_is_array(const struct glsl_type *type)
{
- assert(glsl_type_is_sampler(type));
+ assert(glsl_type_is_sampler(type) || glsl_type_is_image(type));
return type->sampler_array;
}
return glsl_type::float_type;
}
+const glsl_type *
+glsl_vec_type(unsigned n)
+{
+ return glsl_type::vec(n);
+}
+
+const glsl_type *
+glsl_vec4_type(void)
+{
+ return glsl_type::vec4_type;
+}
+
const glsl_type *
glsl_int_type(void)
{
return glsl_type::bool_type;
}
-const glsl_type *
-glsl_vec4_type(void)
-{
- return glsl_type::vec4_type;
-}
-
const glsl_type *
glsl_scalar_type(enum glsl_base_type base_type)
{
return glsl_type::get_sampler_instance(dim, is_shadow, is_array, base_type);
}
+const struct glsl_type *
+glsl_image_type(enum glsl_sampler_dim dim, bool is_array,
+ enum glsl_base_type base_type)
+{
+ return glsl_type::get_image_instance(dim, is_array, base_type);
+}
+
const glsl_type *
glsl_function_type(const glsl_type *return_type,
const glsl_function_param *params, unsigned num_params)