mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 03:08:05 +02:00
compiler/types: Add a contains_32bit helper
Acked-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18540>
This commit is contained in:
parent
5f1f6d7496
commit
6fbf336788
2 changed files with 17 additions and 0 deletions
|
|
@ -239,6 +239,22 @@ glsl_contains_double(const glsl_type *t)
|
|||
}
|
||||
}
|
||||
|
||||
bool
|
||||
glsl_type_contains_32bit(const glsl_type *t)
|
||||
{
|
||||
if (glsl_type_is_array(t)) {
|
||||
return glsl_type_contains_32bit(t->fields.array);
|
||||
} else if (glsl_type_is_struct(t) || glsl_type_is_interface(t)) {
|
||||
for (unsigned int i = 0; i < t->length; i++) {
|
||||
if (glsl_type_contains_32bit(t->fields.structure[i].type))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
return glsl_type_is_32bit(t);
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
glsl_type_contains_64bit(const glsl_type *t)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -824,6 +824,7 @@ unsigned glsl_atomic_size(const glsl_type *type);
|
|||
* Type A contains type B if A is B or A is a composite type (struct,
|
||||
* interface, array) that has an element that contains B.
|
||||
*/
|
||||
bool glsl_type_contains_32bit(const glsl_type *t);
|
||||
bool glsl_type_contains_64bit(const glsl_type *t);
|
||||
bool glsl_type_contains_image(const glsl_type *t);
|
||||
bool glsl_contains_atomic(const glsl_type *t);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue