glsl: fix slow linking of uniforms in the nir linker
Currently the nir linker resizes the amount of storage needed to hold uniform information on the fly while linking. As shaders can contain thousands of uniforms this can be very slow. For example some Godot shaders can take 30 seconds to compile on some machines. In this change we count the amount of storage needed before we start processing the uniforms. This is what the GLSL IR linker does also. Fixes: 95f555a9 ("st/glsl_to_nir: make use of nir linker for linking uniforms") Closes: mesa/mesa#2996 Reviewed-by:Alejandro Piñeiro <apinheiro@igalia.com> Part-of: <mesa/mesa!5137> (cherry picked from commit f1acf492)