[Mesa-dev] [PATCH v2] glsl: Add without_array type predicate
Kenneth Graunke
kenneth at whitecape.org
Tue Jul 29 19:40:01 PDT 2014
On Tuesday, July 29, 2014 04:14:45 PM Ian Romanick wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>
>
> Returns the type without any arrays.
>
> This will be used in later patches in this series.
>
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> Suggested-by: Timothy Arceri <t_arceri at yahoo.com.au>
> Cc: Timothy Arceri <t_arceri at yahoo.com.au>
> ---
> src/glsl/glsl_types.h | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h
> index 0b63d48..9cd132a 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
>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140729/b8ad6647/attachment.sig>
More information about the mesa-dev
mailing list