glsl: move max_index calc to assign_attribute_or_color_locations