mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
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 <luoyonggang@gmail.com> Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23841>
This commit is contained in:
parent
68b9ad0ba7
commit
75ac852253
1 changed files with 1 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue