diff options
author | Ian Romanick <[email protected]> | 2014-09-10 10:54:55 -0700 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2014-09-27 18:56:39 +0100 |
commit | d556ed889d656639dc26d82d0d54467cb57210af (patch) | |
tree | c279f4337aba64d60c4e3a4c5c706c8af2f677e7 /src | |
parent | d9444533aa0839b9661da8f98c0052f7c6ee5207 (diff) |
glsl: Round struct size up to at least 16 bytes
Per rule #9, the size of the structure is vec4 aligned. The MAX2 in the
loop ensures that sizes >= 16 bytes are vec4 aligned. The new MAX2
after the loop ensures that sizes < 16 bytes are vec4 aligned.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82932
Cc: [email protected]
(cherry picked from commit 2ab71e1486e76722154b48faef8216ff8173fd30)
Diffstat (limited to 'src')
-rw-r--r-- | src/glsl/glsl_types.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp index 66e9b133086..56b96f5acf3 100644 --- a/src/glsl/glsl_types.cpp +++ b/src/glsl/glsl_types.cpp @@ -965,7 +965,7 @@ glsl_type::std140_size(bool row_major) const if (field_type->is_record() && (i + 1 < this->length)) size = glsl_align(size, 16); } - size = glsl_align(size, max_align); + size = glsl_align(size, MAX2(max_align, 16)); return size; } |