aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/lower_ubo_reference.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2014-09-08 18:25:15 -0700
committerIan Romanick <[email protected]>2014-09-26 07:59:47 -0700
commit5c75270c344815b15ef73e83421192fd7de35972 (patch)
treeb6c26c5b1140fa5c84d00a61f87e50f143b1cb4b /src/glsl/lower_ubo_reference.cpp
parent8e01c66da6c780601f941aa5b9939962c219fdbd (diff)
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 <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83506 Cc: [email protected]
Diffstat (limited to 'src/glsl/lower_ubo_reference.cpp')
-rw-r--r--src/glsl/lower_ubo_reference.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/glsl/lower_ubo_reference.cpp b/src/glsl/lower_ubo_reference.cpp
index 4ae1aac7765..f3920b362ce 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);
}