From 75ac852253d33b050e7ff3c3cdd866cad9e4dfa6 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Fri, 23 Jun 2023 20:31:00 +0800 Subject: [PATCH] compiler: set alignment=1 by default for handling empty struct/interface in glsl_types.cpp When there is no elements in struct/interface, the alignment of it should be 1 instead of 0. Signed-off-by: Yonggang Luo Reviewed-by: Emma Anholt Part-of: --- src/compiler/glsl_types.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp index 3929b95..e33a5b4 100644 --- a/src/compiler/glsl_types.cpp +++ b/src/compiler/glsl_types.cpp @@ -2697,7 +2697,7 @@ glsl_type::get_explicit_type_for_size_align(glsl_type_size_align_func type_info, malloc(sizeof(struct glsl_struct_field) * this->length); *size = 0; - *alignment = 0; + *alignment = 1; for (unsigned i = 0; i < this->length; i++) { fields[i] = this->fields.structure[i]; assert(fields[i].matrix_layout != GLSL_MATRIX_LAYOUT_ROW_MAJOR); -- 2.7.4