nir/types: Add some asserts to glsl_get_struct_field()

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19430>
This commit is contained in:
Jason Ekstrand 2022-10-31 22:32:19 -05:00 committed by Marge Bot
parent 4bf116d440
commit 15796bdd0e

View file

@ -75,6 +75,8 @@ glsl_get_bare_type(const glsl_type *type)
const glsl_type *
glsl_get_struct_field(const glsl_type *type, unsigned index)
{
assert(type->is_struct() || type->is_interface());
assert(index < type->length);
return type->fields.structure[index].type;
}