From: Timothy Arceri Date: Tue, 19 Aug 2014 07:40:50 +0000 (-1000) Subject: glsl: add arrays of arrays support to without_array function X-Git-Tag: upstream/17.1.0~19246 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fda5f7bb2f23b4adb2f2684162dfb36fe0cb8641;p=platform%2Fupstream%2Fmesa.git glsl: add arrays of arrays support to without_array function Signed-off-by: Timothy Arceri Reviewed-by: Ilia Mirkin --- diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h index d383dd5..5645dcd 100644 --- a/src/glsl/glsl_types.h +++ b/src/glsl/glsl_types.h @@ -540,7 +540,12 @@ struct glsl_type { */ const glsl_type *without_array() const { - return this->is_array() ? this->fields.array : this; + const glsl_type *t = this; + + while (t->is_array()) + t = t->fields.array; + + return t; } /**