Commit b3c04362 authored by Francisco Jerez's avatar Francisco Jerez

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.

Cc: "9.1 9.2" <>
Reviewed-by: default avatarIan Romanick <>
Tested-by: default avatarKenneth Graunke <>
parent 373f8670
......@@ -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,
/* Only the first leaf-field of the record gets called with the
* record type pointer.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment