nir_types: add glsl_varying_count helper