glsl/linker: Defer recording transform feedback locations.
glsl/linker: Defer recording transform feedback locations.

This patch subdivides the loop that assigns varying locations into two
phases: one phase to match up varyings between shader stages (and
assign them varying locations), and a second phase to record the
varying assignments for use by transform feedback.

This paves the way for varying packing, which will require us to
further subdivide the first phase.

In addition, it lets us avoid a clumsy O(n^2) algorithm, since we can
now record the locations of all transform feedback varyings in a
single pass through the tfeedback_decls array, rather than have to
iterate through the array after assigning each varying.

Reviewed-by: Eric Anholt <96f164ad4d9b2b0dacf8ebee2bb1eeb3aa69adf1@anholt.net>

mcanthony/glsl-optimizer,benaadams/glsl-optimizer,jbarczak/glsl-optimizer,dellis1972/glsl-optimizer,wolf96/glsl-optimizer,bkaradzic/glsl-optimizer,djreep81/glsl-optimizer,wolf96/glsl-optimizer,mcanthony/glsl-optimizer,dellis1972/glsl-optimizer,dellis1972/glsl-optimizer,tokyovigilante/glsl-optimizer,tokyovigilante/glsl-optimizer,benaadams/glsl-optimizer,bkaradzic/glsl-optimizer,zeux/glsl-optimizer,tokyovigilante/glsl-optimizer,djreep81/glsl-optimizer,metora/MesaGLSLCompiler,tokyovigilante/glsl-optimizer,mapbox/glsl-optimizer,zeux/glsl-optimizer,benaadams/glsl-optimizer,mcanthony/glsl-optimizer,wolf96/glsl-optimizer,mcanthony/glsl-optimizer,dellis1972/glsl-optimizer,zeux/glsl-optimizer,mapbox/glsl-optimizer,benaadams/glsl-optimizer,mcanthony/glsl-optimizer,zz85/glsl-optimizer,dellis1972/glsl-optimizer,bkaradzic/glsl-optimizer,benaadams/glsl-optimizer,bkaradzic/glsl-optimizer,jbarczak/glsl-optimizer,wolf96/glsl-optimizer,benaadams/glsl-optimizer,wolf96/glsl-optimizer,metora/MesaGLSLCompiler,zz85/glsl-optimizer,jbarczak/glsl-optimizer,metora/MesaGLSLCompiler,zz85/glsl-optimizer,djreep81/glsl-optimizer,mapbox/glsl-optimizer,zz85/glsl-optimizer,bkaradzic/glsl-optimizer,djreep81/glsl-optimizer,zeux/glsl-optimizer,zeux/glsl-optimizer,jbarczak/glsl-optimizer,mapbox/glsl-optimizer,mapbox/glsl-optimizer,djreep81/glsl-optimizer,zz85/glsl-optimizer,tokyovigilante/glsl-optimizer,jbarczak/glsl-optimizer,zz85/glsl-optimizer