Skip to content

glsl: refactor code to avoid static analyzer noise

Marcin Ślusarz requested to merge mslusarz/mesa:glsl-refactor-uninit into main

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).

Merge request reports