Mesa (master): glsl: Make sure row-major array-of-structure get correct layout
Ian Romanick
idr at kemper.freedesktop.org
Fri Sep 26 14:58:15 UTC 2014
Module: Mesa
Branch: master
Commit: 2260450960706e59fa1694cfa29299712b425f94
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2260450960706e59fa1694cfa29299712b425f94
Author: Ian Romanick <ian.d.romanick at intel.com>
Date: Mon Sep 8 18:25:15 2014 -0700
glsl: Make sure row-major array-of-structure get correct layout
Whether or not the field is row-major (because it might be a bvec2 or
something) does not affect the array itself. We need to know whether an
array element in its entirety is row-major.
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83506
Cc: mesa-stable at lists.freedesktop.org
---
src/glsl/lower_ubo_reference.cpp | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/glsl/lower_ubo_reference.cpp b/src/glsl/lower_ubo_reference.cpp
index 4ae1aac..f3920b3 100644
--- a/src/glsl/lower_ubo_reference.cpp
+++ b/src/glsl/lower_ubo_reference.cpp
@@ -301,7 +301,14 @@ lower_ubo_reference_visitor::handle_rvalue(ir_rvalue **rvalue)
deref = deref_array->array->as_dereference();
break;
} else {
- array_stride = deref_array->type->std140_size(row_major);
+ /* Whether or not the field is row-major (because it might be a
+ * bvec2 or something) does not affect the array itself. We need
+ * to know whether an array element in its entirety is row-major.
+ */
+ const bool array_row_major =
+ is_dereferenced_thing_row_major(deref_array);
+
+ array_stride = deref_array->type->std140_size(array_row_major);
array_stride = glsl_align(array_stride, 16);
}
More information about the mesa-commit
mailing list