mesa/st: Backport WPOS adjustment fixes from st_mesa_to_tgsi.c to st_glsl_to_tgsi.cpp.
mesa/st: Backport WPOS adjustment fixes from st_mesa_to_tgsi.c to st_glsl_to_tgsi.cpp.

This is a trivial verbatim copy of the code from Christoph Bumiller's commit
f986a6560f3ee9a79b89e9409e3a9ac52b53315c.

Fixes fdo 39939 and 39942.

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