Mesa (master): glsl: add arrays of arrays support to without_array function
Timothy Arceri
tarceri at kemper.freedesktop.org
Mon Apr 27 11:39:53 UTC 2015
Module: Mesa
Branch: master
Commit: fda5f7bb2f23b4adb2f2684162dfb36fe0cb8641
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=fda5f7bb2f23b4adb2f2684162dfb36fe0cb8641
Author: Timothy Arceri <t_arceri at yahoo.com.au>
Date: Mon Aug 18 21:40:50 2014 -1000
glsl: add arrays of arrays support to without_array function
Signed-off-by: Timothy Arceri <t_arceri at yahoo.com.au>
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
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 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;
}
/**
More information about the mesa-commit
mailing list