return offset;
}
-unsigned
-glsl_type::uniform_locations() const
+extern "C" unsigned
+glsl_type_uniform_locations(const struct glsl_type *t)
{
unsigned size = 0;
- switch (this->base_type) {
+ switch (t->base_type) {
case GLSL_TYPE_UINT:
case GLSL_TYPE_INT:
case GLSL_TYPE_FLOAT:
case GLSL_TYPE_STRUCT:
case GLSL_TYPE_INTERFACE:
- for (unsigned i = 0; i < this->length; i++)
- size += this->fields.structure[i].type->uniform_locations();
+ for (unsigned i = 0; i < t->length; i++)
+ size += glsl_type_uniform_locations(t->fields.structure[i].type);
return size;
case GLSL_TYPE_ARRAY:
- return this->length * this->fields.array->uniform_locations();
+ return t->length * glsl_type_uniform_locations(t->fields.array);
default:
return 0;
}
unsigned glsl_get_component_slots(const struct glsl_type *t);
unsigned glsl_get_component_slots_aligned(const struct glsl_type *t, unsigned offset);
unsigned glsl_varying_count(const struct glsl_type *t);
+unsigned glsl_type_uniform_locations(const struct glsl_type *t);
static inline unsigned
glsl_count_attribute_slots(const struct glsl_type *t, bool is_gl_vertex_input)
inline unsigned glsl_type::varying_count() const { return glsl_varying_count(this); }
inline unsigned glsl_type::atomic_size() const { return glsl_atomic_size(this); }
inline int glsl_type::coordinate_components() const { return glsl_get_sampler_coordinate_components(this); }
+inline unsigned glsl_type::uniform_locations() const { return glsl_type_uniform_locations(this); }
inline unsigned glsl_type::cl_size() const { return glsl_get_cl_size(this); }
inline unsigned glsl_type::cl_alignment() const { return glsl_get_cl_alignment(this); }