Commit ef9c9cee authored by Boris Brezillon's avatar Boris Brezillon Committed by Erik Faye-Lund
Browse files

glsl: Propagate packed info in get_explicit_type_for_size_align()



Right now, when calling get_explicit_type_for_size_align() on a packed
struct, the packed attribute is lost and field offsets are wrong.
Signed-off-by: Boris Brezillon's avatarBoris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand's avatarJason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jesse Natalie's avatarJesse Natalie <jenatali@microsoft.com>
Part-of: <mesa/mesa!6472>
parent 18ed5fe5
......@@ -2450,7 +2450,17 @@ glsl_type::get_explicit_type_for_size_align(glsl_type_size_align_func type_info,
*alignment = MAX2(*alignment, field_align);
}
const glsl_type *type = glsl_type::get_struct_instance(fields, this->length, this->name, this->packed);
const glsl_type *type;
if (this->is_struct()) {
type = get_struct_instance(fields, this->length, this->name,
this->packed);
} else {
assert(!this->packed);
type = get_interface_instance(fields, this->length,
(enum glsl_interface_packing)this->interface_packing,
this->interface_row_major,
this->name);
}
free(fields);
return type;
} else if (this->is_matrix()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment