From d4c70e483d403bf0ea1af20db0a9d74b649172cc Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Thu, 1 Dec 2022 11:09:44 -0800 Subject: [PATCH] compiler: Handle nested arrays correctly for computing CL size/alignment Reviewed-by: Karol Herbst Reviewed-by: Sil Vilerino Part-of: --- src/compiler/glsl_types.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp index ded90a59c28..2bc7d1d7445 100644 --- a/src/compiler/glsl_types.cpp +++ b/src/compiler/glsl_types.cpp @@ -3333,7 +3333,7 @@ glsl_type::cl_alignment() const if (this->is_scalar() || this->is_vector()) return this->cl_size(); else if (this->is_array()) - return this->without_array()->cl_alignment(); + return this->fields.array->cl_alignment(); else if (this->is_struct()) { /* Packed Structs are 0x1 aligned despite their size. */ if (this->packed) @@ -3356,7 +3356,7 @@ glsl_type::cl_size() const return util_next_power_of_two(this->vector_elements) * explicit_type_scalar_byte_size(this); } else if (this->is_array()) { - unsigned size = this->without_array()->cl_size(); + unsigned size = this->fields.array->cl_size(); return size * this->length; } else if (this->is_struct()) { unsigned size = 0;