glsl: Perform implicit type conversions on function call out parameters.
glsl: Perform implicit type conversions on function call out parameters.

When an out parameter undergoes an implicit type conversion, we need
to store it in a temporary, and then after the call completes, convert
the resulting value.  In other words, we convert code like the
following:

void f(out int x);
float value;
f(value);

Into IR that's equivalent to this:

void f(out int x);
float value;
int out_parameter_conversion;
f(out_parameter_conversion);
value = float(out_parameter_conversion);

This transformation needs to happen during ast-to-IR convertion (as
opposed to, say, a lowering pass), because it is invalid IR for formal
and actual parameters to have types that don't match.

Fixes piglit tests
spec/glsl-1.20/compiler/qualifiers/out-conversion-int-to-float.vert and
spec/glsl-1.20/execution/qualifiers/vs-out-conversion-*.shader_test,
and bug 39651.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39651

Reviewed-by: Chad Versace <c34c009102e60d77975598e1f414f8a701c22d0b@chad-versace.us>

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