glsl: split out varying and uniform linking code