Mesa (9.2): glsl: Fix usage of the wrong union member in program_resource_visitor::recursion .
Carl Worth
cworth at kemper.freedesktop.org
Wed Oct 16 22:10:51 UTC 2013
Module: Mesa
Branch: 9.2
Commit: 6d6d8fb0732605440e1e6bc318942785886d4e23
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6d6d8fb0732605440e1e6bc318942785886d4e23
Author: Francisco Jerez <currojerez at riseup.net>
Date: Fri Sep 20 18:36:08 2013 -0700
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" <mesa-stable at lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Tested-by: Kenneth Graunke <kenneth at whitecape.org>
(cherry picked from commit b3c04362b44a4eceb38c938ceb387a9c04d06973)
---
src/glsl/link_uniforms.cpp | 4 ++--
1 files 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-commit
mailing list