glsl: remove some duplicate code from the nir uniform linker