glsl: add arrays of arrays support to without_array function
authorTimothy Arceri <t_arceri@yahoo.com.au>
Tue, 19 Aug 2014 07:40:50 +0000 (21:40 -1000)
committerTimothy Arceri <t_arceri@yahoo.com.au>
Mon, 27 Apr 2015 11:30:54 +0000 (21:30 +1000)
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/glsl/glsl_types.h

index d383dd5..5645dcd 100644 (file)
@@ -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;
    }
 
    /**