compiler/types: Allow images and samplers in get_explicit_type_for_size_align

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7069>
This commit is contained in:
Jason Ekstrand
2020-10-06 12:40:45 -05:00
committed by Karol Herbst
parent 0021d3ae87
commit eb965719ab
+5 -1
View File
@@ -2472,7 +2472,11 @@ const glsl_type *
glsl_type::get_explicit_type_for_size_align(glsl_type_size_align_func type_info,
unsigned *size, unsigned *alignment) const
{
if (this->is_scalar()) {
if (this->is_image() || this->is_sampler()) {
type_info(this, size, alignment);
assert(*alignment > 0);
return this;
} else if (this->is_scalar()) {
type_info(this, size, alignment);
assert(*size == explicit_type_scalar_byte_size(this));
assert(*alignment == explicit_type_scalar_byte_size(this));