2017-02-23 18:24:59 +00:00
|
|
|
#version 310 es
|
2017-02-24 08:56:17 +00:00
|
|
|
precision highp float;
|
2017-02-23 18:24:59 +00:00
|
|
|
|
|
|
|
struct Inputs
|
|
|
|
{
|
|
|
|
vec4 a;
|
|
|
|
vec2 b;
|
|
|
|
};
|
|
|
|
|
|
|
|
layout(location = 0) in Inputs vin;
|
|
|
|
layout(location = 0) out vec4 FragColor;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
// Read struct once.
|
|
|
|
Inputs v0 = vin;
|
|
|
|
// Read struct again.
|
|
|
|
Inputs v1 = vin;
|
|
|
|
|
|
|
|
// Read members individually.
|
|
|
|
vec4 a = vin.a;
|
|
|
|
vec4 b = vin.b.xxyy;
|
|
|
|
|
|
|
|
FragColor = v0.a + v0.b.xxyy + v1.a + v1.b.yyxx + a + b;
|
|
|
|
}
|