diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2014-07-19 14:07:18 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2014-08-04 14:40:06 -0700 |
commit | 22f7a46d74d702b84de77d4465069776e34f617d (patch) | |
tree | c1e1abec50348082003609338e94b5566da528ee /src/glsl | |
parent | 146be3ddbe1e3cf8154bcc59cc5bcbd90e2072cb (diff) | |
download | external_mesa3d-22f7a46d74d702b84de77d4465069776e34f617d.zip external_mesa3d-22f7a46d74d702b84de77d4465069776e34f617d.tar.gz external_mesa3d-22f7a46d74d702b84de77d4465069776e34f617d.tar.bz2 |
glsl: Add without_array type predicate
Returns the type without any arrays.
This will be used in later patches in this series.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Suggested-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/glsl_types.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h index 50cd655..92578ff 100644 --- a/src/glsl/glsl_types.h +++ b/src/glsl/glsl_types.h @@ -465,6 +465,18 @@ struct glsl_type { } /** + * Get the type stripped of any arrays + * + * \return + * Pointer to the type of elements of the first non-array type for array + * types, or pointer to itself for non-array types. + */ + const glsl_type *without_array() const + { + return this->is_array() ? this->fields.array : this; + } + + /** * Return the amount of atomic counter storage required for a type. */ unsigned atomic_size() const |