[Mesa-dev] [PATCH] glsl: Fix usage of the wrong union member in program_resource_visitor::recursion.

Ian Romanick idr at freedesktop.org
Fri Oct 4 10:03:35 PDT 2013


On 09/20/2013 07:28 PM, Francisco Jerez wrote:
> 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.

Yeah, this looks like a dumb copy-and-paste mistake.

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Cc: "9.1 9.2" <mesa-stable at lists.freedesktop.org>

> ---
>  src/glsl/link_uniforms.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp
> index fa77157..6cec96e 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.
> 



More information about the mesa-dev mailing list