bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-vectorize-tex-in.txt

18 lines
483 B
Text
Raw Normal View History

2014-10-11 15:32:43 -04:00
uniform sampler2D _MainTex;
uniform sampler2D _RampTex;
varying vec2 varUV;
void main()
{
vec4 orig = texture2D (_MainTex, varUV);
// There was a bug where these three texture
// samples were "vectorized" in a wrong way, like
// t.xyz = texture2DProj (_RampTex, t.xyz).xyz;
float rr = texture2D (_RampTex, orig.xx).x;
float gg = texture2D (_RampTex, orig.yy).y;
float bb = texture2D (_RampTex, orig.zz).z;
vec4 color = vec4 (rr, gg, bb, orig.w);
gl_FragData[0] = color;
}