From eb965719abfe740a09c839565a3f0d9f286be130 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Tue, 6 Oct 2020 12:40:45 -0500 Subject: [PATCH] compiler/types: Allow images and samplers in get_explicit_type_for_size_align Reviewed-by: Karol Herbst Reviewed-by: Dave Airlie Part-of: --- src/compiler/glsl_types.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp index b0c99e82ad0..a4755798744 100644 --- a/src/compiler/glsl_types.cpp +++ b/src/compiler/glsl_types.cpp @@ -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));