SPIRV-Cross/reference/shaders/frag/for-loop-init.frag

53 lines
887 B
GLSL
Raw Normal View History

2016-12-16 11:43:12 +00:00
#version 310 es
precision mediump float;
precision highp int;
layout(location = 0) out mediump int FragColor;
void main()
{
FragColor = 16;
for (mediump int i = 0; i < 25; i++)
2016-12-16 11:43:12 +00:00
{
FragColor += 10;
2016-12-16 11:43:12 +00:00
}
for (mediump int i_1 = 1, j = 4; i_1 < 30; i_1++, j += 4)
2016-12-16 11:43:12 +00:00
{
FragColor += 11;
2016-12-16 11:43:12 +00:00
}
mediump int k = 0;
for (; k < 20; k++)
2016-12-16 11:43:12 +00:00
{
FragColor += 12;
2016-12-16 11:43:12 +00:00
}
k += 3;
FragColor += k;
2016-12-16 11:43:12 +00:00
mediump int l;
if (k == 40)
{
l = 0;
for (; l < 40; l++)
2016-12-16 11:43:12 +00:00
{
FragColor += 13;
2016-12-16 11:43:12 +00:00
}
return;
}
else
{
l = k;
FragColor += l;
2016-12-16 11:43:12 +00:00
}
mediump ivec2 i_2 = ivec2(0);
for (; i_2.x < 10; i_2.x += 4)
2016-12-16 11:43:12 +00:00
{
FragColor += i_2.y;
2016-12-16 11:43:12 +00:00
}
mediump int o = k;
for (mediump int m = k; m < 40; m++)
2016-12-16 11:43:12 +00:00
{
FragColor += m;
2016-12-16 11:43:12 +00:00
}
FragColor += o;
2016-12-16 11:43:12 +00:00
}