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 <>
Reviewed-by: Jason Ekstrand's avatarJason Ekstrand <>
Reviewed-by: Jesse Natalie's avatarJesse Natalie <>
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,
} else {
type = get_interface_instance(fields, this->length,
(enum glsl_interface_packing)this->interface_packing,
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