glsl: move calculate_subroutine_compat() to shared linker code