nir: Expose the packed attribute attached to glsl_type objects

This should help code calculating field offsets to get it right when
the structure is marked packed.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6472>
This commit is contained in:
Boris Brezillon
2020-06-29 09:29:09 +02:00
committed by Marge Bot
parent 42f97f8ce3
commit 3be890a3a6
2 changed files with 7 additions and 0 deletions

View File

@@ -860,6 +860,12 @@ glsl_get_explicit_size(const struct glsl_type *type, bool align_to_stride)
return type->explicit_size(align_to_stride);
}
bool
glsl_type_is_packed(const struct glsl_type *type)
{
return type->packed;
}
bool
glsl_type_is_leaf(const struct glsl_type *type)
{

View File

@@ -129,6 +129,7 @@ glsl_get_bit_size(const struct glsl_type *type)
return glsl_base_type_get_bit_size(glsl_get_base_type(type));
}
bool glsl_type_is_packed(const struct glsl_type *type);
bool glsl_type_is_16bit(const struct glsl_type *type);
bool glsl_type_is_32bit(const struct glsl_type *type);
bool glsl_type_is_64bit(const struct glsl_type *type);