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 d383dd5bef17e18f7e71937a6df66bbf70ec2bc3..5645dcd5011c3b13e3004d630f69850c753e5e5f 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;
    }
 
    /**