recursion(var->type, &name, strlen(name), false);
ralloc_free(name);
} else {
- this->visit_field(t, var->name);
+ this->visit_field(t, var->name, false);
}
}
t->fields.structure[i].row_major);
}
} else {
- this->visit_field(t, *name);
+ this->visit_field(t, *name, row_major);
}
}
unsigned num_shader_uniform_components;
private:
- virtual void visit_field(const glsl_type *type, const char *name)
+ virtual void visit_field(const glsl_type *type, const char *name,
+ bool row_major)
{
assert(!type->is_record());
assert(!(type->is_array() && type->fields.array->is_record()));
+ (void) row_major;
+
/* Count the number of samplers regardless of whether the uniform is
* already in the hash table. The hash table prevents adding the same
* uniform for multiple shader targets, but in this case we want to
int ubo_byte_offset;
private:
- virtual void visit_field(const glsl_type *type, const char *name)
+ virtual void visit_field(const glsl_type *type, const char *name,
+ bool row_major)
{
assert(!type->is_record());
assert(!(type->is_array() && type->fields.array->is_record()));
+ (void) row_major;
+
unsigned id;
bool found = this->map->get(id, name);
assert(found);
*
* \param type Type of the field.
* \param name Fully qualified name of the field.
+ * \param row_major For a matrix type, is it stored row-major.
*/
- virtual void visit_field(const glsl_type *type, const char *name) = 0;
+ virtual void visit_field(const glsl_type *type, const char *name,
+ bool row_major) = 0;
private:
/**
}
private:
- virtual void visit_field(const glsl_type *type, const char *name);
+ virtual void visit_field(const glsl_type *type, const char *name,
+ bool row_major);
struct gl_shader_program *shader_program;
struct gl_program_parameter_list *params;
};
void
-add_uniform_to_shader::visit_field(const glsl_type *type, const char *name)
+add_uniform_to_shader::visit_field(const glsl_type *type, const char *name,
+ bool row_major)
{
unsigned int size;
+ (void) row_major;
+
if (type->is_vector() || type->is_scalar()) {
size = type->vector_elements;
} else {