mesa: fix a GLSL vector subscript/writemask bug
mesa: fix a GLSL vector subscript/writemask bug

This fixes a failure for cases like:
   vec4 v;
   v[1] *= 2.0;

The v[1] actually acts like a writemask, equivalent to v.y
The fix is a bit convoluted, but will do for now.

cherry-picked from master

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