mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 15:48:36 +02:00
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>
This commit is contained in:
parent
146be3ddbe
commit
22f7a46d74
1 changed files with 12 additions and 0 deletions
|
|
@ -464,6 +464,18 @@ struct glsl_type {
|
|||
return base_type == GLSL_TYPE_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue