Move count_attribute_slots() out of the linker and into glsl_type.