[Mesa-dev] [PATCH 1/3] glsl: add arrays of arrays support to without_array function
Timothy Arceri
t_arceri at yahoo.com.au
Fri Sep 26 19:35:28 PDT 2014
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 eeb14c2..f1d578e 100644
--- a/src/glsl/glsl_types.h
+++ b/src/glsl/glsl_types.h
@@ -505,7 +505,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;
}
/**
--
1.9.3
More information about the mesa-dev
mailing list