glsl: Add support for comparing function parameter conversions
glsl: Add support for comparing function parameter conversions

The ARB_gpu_shader5 spec says:

"To determine whether the conversion for a single argument in one match is
better than that for another match, the following rules are applied, in
order:

  1. An exact match is better than a match involving any implicit
     conversion.

  2. A match involving an implicit conversion from float to double is
     better than a match involving any other implicit conversion.

  3. A match involving an implicit conversion from either int or uint to
     float is better than a match involving an implicit conversion from
     either int or uint to double.

If none of the rules above apply to a particular pair of conversions,
neither conversion is considered better than the other."

V3: Add spec citation, including oddball difference between gs5 and GLSL
4.0; comment a bit better as per Jordan's suggestions.

Signed-off-by: Chris Forbes <5dcac483e7a6e31a5cbe89f38cc69dff8ee93dac@ijw.co.nz>
Reviewed-by: Jordan Justen <a79006884ba9cf5f4f7fcbb92a15b208780d8c97@intel.com>

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