<div dir="ltr">On 22 January 2013 00:52, Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org" target="_blank">idr@freedesktop.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>><br>
<br>
Not used yet, but the UBO layout visitor will use this.<br>
<br>
Signed-off-by: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>><br>
---<br>
src/glsl/link_uniforms.cpp | 10 ++++++----<br>
src/glsl/linker.h | 3 ++-<br>
2 files changed, 8 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp<br>
index c639a3d..66a2804 100644<br>
--- a/src/glsl/link_uniforms.cpp<br>
+++ b/src/glsl/link_uniforms.cpp<br>
@@ -65,7 +65,7 @@ uniform_field_visitor::process(ir_variable *var)<br>
/* Only strdup the name if we actually will need to modify it. */<br>
if (t->is_record() || (t->is_array() && t->fields.array->is_record())) {<br>
char *name = ralloc_strdup(NULL, var->name);<br>
- recursion(var->type, &name, strlen(name));<br>
+ recursion(var->type, &name, strlen(name), false);<br></blockquote><div><br></div><div>It's not clear to me why it's ok to pass "false" for row_major here. Can you clarify?<br></div><div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
ralloc_free(name);<br>
} else {<br>
this->visit_field(t, var->name);<br>
@@ -74,7 +74,7 @@ uniform_field_visitor::process(ir_variable *var)<br>
<br>
void<br>
uniform_field_visitor::recursion(const glsl_type *t, char **name,<br>
- size_t name_length)<br>
+ size_t name_length, bool row_major)<br>
{<br>
/* Records need to have each field processed individually.<br>
*<br>
@@ -90,7 +90,8 @@ uniform_field_visitor::recursion(const glsl_type *t, char **name,<br>
/* Append '.field' to the current uniform name. */<br>
ralloc_asprintf_rewrite_tail(name, &new_length, ".%s", field);<br>
<br>
- recursion(t->fields.structure[i].type, name, new_length);<br>
+ recursion(t->fields.structure[i].type, name, new_length,<br>
+ t->fields.structure[i].row_major);<br>
}<br>
} else if (t->is_array() && t->fields.array->is_record()) {<br>
for (unsigned i = 0; i < t->length; i++) {<br>
@@ -99,7 +100,8 @@ uniform_field_visitor::recursion(const glsl_type *t, char **name,<br>
/* Append the subscript to the current uniform name */<br>
ralloc_asprintf_rewrite_tail(name, &new_length, "[%u]", i);<br>
<br>
- recursion(t->fields.array, name, new_length);<br>
+ recursion(t->fields.array, name, new_length,<br>
+ t->fields.structure[i].row_major);<br>
}<br>
} else {<br>
this->visit_field(t, *name);<br>
diff --git a/src/glsl/linker.h b/src/glsl/linker.h<br>
index c8f3844..2af1925 100644<br>
--- a/src/glsl/linker.h<br>
+++ b/src/glsl/linker.h<br>
@@ -92,7 +92,8 @@ private:<br>
* \param name_length Length of the current name \b not including the<br>
* terminating \c NUL character.<br>
*/<br>
- void recursion(const glsl_type *t, char **name, size_t name_length);<br>
+ void recursion(const glsl_type *t, char **name, size_t name_length,<br>
+ bool row_major);<br>
};<br>
<br>
void<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.11.7<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>