glsl/linker: Refactor in preparation for adding more shader stages.