[Mesa-dev] [RFC PATCH 02/12] glsl: add arrays of arrays support to without_array function

Timothy Arceri t_arceri at yahoo.com.au
Sat Mar 21 02:49:12 PDT 2015


Signed-off-by: Timothy Arceri <t_arceri at yahoo.com.au>
---
 src/glsl/glsl_types.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h
index 7359e94..f5bc846 100644
--- a/src/glsl/glsl_types.h
+++ b/src/glsl/glsl_types.h
@@ -534,7 +534,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;
    }
 
    /**
-- 
2.1.0



More information about the mesa-dev mailing list