diff options
author | Samuel Iglesias Gonsalvez <[email protected]> | 2015-09-22 16:25:46 +0200 |
---|---|---|
committer | Samuel Iglesias Gonsalvez <[email protected]> | 2015-10-06 14:02:13 +0200 |
commit | 82db642042585ddb54a2da44730b082062188d65 (patch) | |
tree | ac99eec7fd408aec6ee0cde7d5e46e4b467f440b /src | |
parent | 64831832791139328a67b80387f062d39e304d24 (diff) |
glsl: add std430 layout support for AoA
Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/glsl/glsl_types.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp index 25927f67c44..b9cb97cbeae 100644 --- a/src/glsl/glsl_types.cpp +++ b/src/glsl/glsl_types.cpp @@ -1557,8 +1557,8 @@ glsl_type::std430_size(bool row_major) const unsigned int array_len; if (this->is_array()) { - element_type = this->fields.array; - array_len = this->length; + element_type = this->without_array(); + array_len = this->arrays_of_arrays_size(); } else { element_type = this; array_len = 1; @@ -1581,10 +1581,12 @@ glsl_type::std430_size(bool row_major) const } if (this->is_array()) { - if (this->fields.array->is_record()) - return this->length * this->fields.array->std430_size(row_major); + if (this->without_array()->is_record()) + return this->arrays_of_arrays_size() * + this->without_array()->std430_size(row_major); else - return this->length * this->fields.array->std430_base_alignment(row_major); + return this->arrays_of_arrays_size() * + this->without_array()->std430_base_alignment(row_major); } if (this->is_record() || this->is_interface()) { |