2018-02-02 09:10:17 +00:00
|
|
|
#version 310 es
|
|
|
|
precision mediump float;
|
|
|
|
precision highp int;
|
|
|
|
|
2018-09-27 09:10:22 +00:00
|
|
|
const float _16[4] = float[](1.0, 4.0, 3.0, 2.0);
|
|
|
|
|
2018-02-02 09:10:17 +00:00
|
|
|
struct Foo
|
|
|
|
{
|
|
|
|
float a;
|
|
|
|
float b;
|
|
|
|
};
|
|
|
|
|
|
|
|
layout(location = 0) out vec4 FragColor;
|
2018-05-04 21:53:32 +00:00
|
|
|
layout(location = 0) flat in mediump int line;
|
2018-02-02 09:10:17 +00:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2018-09-27 09:10:22 +00:00
|
|
|
Foo foos[2] = Foo[](Foo(10.0, 20.0), Foo(30.0, 40.0));
|
|
|
|
FragColor = vec4(_16[line]);
|
2018-07-05 12:14:18 +00:00
|
|
|
FragColor += vec4(foos[line].a * foos[1 - line].a);
|
2018-02-02 09:10:17 +00:00
|
|
|
}
|
|
|
|
|