glsl: refactor code to avoid static analyzer noise
Clang analyzer thinks struct_base_offset
can be used uninitialized
because it doesn't know that glsl_type_is_struct_or_ifc
returns
the same value for the same type.
Refactor the code to make it clear what is going on. As a side effect
this should be faster because glsl_get_length
and
glsl_type_is_struct_or_ifc
will be called only once (they are not
inline functions).
This is an alternative approach to !12399 (closed).