From: Francisco Jerez Date: Sat, 21 Sep 2013 01:36:08 +0000 (-0700) Subject: glsl: Fix usage of the wrong union member in program_resource_visitor::recursion. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b3c04362b44a4eceb38c938ceb387a9c04d06973;p=mesa.git glsl: Fix usage of the wrong union member in program_resource_visitor::recursion. In the array-of-struct case, recursion() takes the row_major flag for each iteration from 't->fields.structure[i]', but 't' is not a record type. Inherit the array declaration row_major flag instead. This mistake was found by running piglit on valgrind. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69449 Cc: "9.1 9.2" Reviewed-by: Ian Romanick Tested-by: Kenneth Graunke --- diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp index 03cbcd1ce20..1cdd5a922b1 100644 --- a/src/glsl/link_uniforms.cpp +++ b/src/glsl/link_uniforms.cpp @@ -140,8 +140,8 @@ program_resource_visitor::recursion(const glsl_type *t, char **name, /* Append the subscript to the current variable name */ ralloc_asprintf_rewrite_tail(name, &new_length, "[%u]", i); - recursion(t->fields.array, name, new_length, - t->fields.structure[i].row_major, record_type); + recursion(t->fields.array, name, new_length, row_major, + record_type); /* Only the first leaf-field of the record gets called with the * record type pointer.