2017-03-07 12:27:04 +00:00
|
|
|
#version 310 es
|
2017-03-07 15:22:47 +00:00
|
|
|
#extension GL_EXT_shader_io_blocks : require
|
2017-03-07 12:27:04 +00:00
|
|
|
|
|
|
|
struct Foo
|
|
|
|
{
|
|
|
|
vec3 a;
|
|
|
|
vec3 b;
|
|
|
|
vec3 c;
|
|
|
|
};
|
|
|
|
|
2017-03-07 15:22:47 +00:00
|
|
|
// This will lock to input location 2.
|
2017-03-07 12:27:04 +00:00
|
|
|
layout(location = 2) in vec4 Input2;
|
2017-03-07 15:22:47 +00:00
|
|
|
// This will lock to input location 4.
|
2017-03-07 12:27:04 +00:00
|
|
|
layout(location = 4) in vec4 Input4;
|
2017-03-07 15:22:47 +00:00
|
|
|
// This will pick first available, which is 0.
|
2017-06-21 07:39:08 +00:00
|
|
|
layout(location = 0) in vec4 Input0;
|
2017-03-07 12:27:04 +00:00
|
|
|
|
2017-03-07 15:22:47 +00:00
|
|
|
// Locks output 0.
|
2017-03-07 12:27:04 +00:00
|
|
|
layout(location = 0) out float vLocation0;
|
2017-03-07 15:22:47 +00:00
|
|
|
// Locks output 1.
|
2017-03-07 12:27:04 +00:00
|
|
|
layout(location = 1) out float vLocation1;
|
2017-03-07 15:22:47 +00:00
|
|
|
// Picks first available two locations, so, 2 and 3.
|
2017-06-21 07:39:08 +00:00
|
|
|
layout(location = 2) out float vLocation2[2];
|
2017-03-07 15:22:47 +00:00
|
|
|
// Picks first available location, 4.
|
2017-06-21 07:39:08 +00:00
|
|
|
layout(location = 4) out Foo vLocation4;
|
2017-03-07 15:22:47 +00:00
|
|
|
// Picks first available location 9.
|
2017-06-21 07:39:08 +00:00
|
|
|
layout(location = 9) out float vLocation9;
|
2017-03-07 15:22:47 +00:00
|
|
|
|
|
|
|
// Locks location 7 and 8.
|
|
|
|
layout(location = 7) out VertexOut
|
|
|
|
{
|
|
|
|
vec3 color;
|
|
|
|
vec3 foo;
|
|
|
|
} vout;
|
2017-03-07 12:27:04 +00:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
gl_Position = vec4(1.0) + Input2 + Input4 + Input0;
|
|
|
|
vLocation0 = 0.0;
|
|
|
|
vLocation1 = 1.0;
|
|
|
|
vLocation2[0] = 2.0;
|
|
|
|
vLocation2[1] = 2.0;
|
|
|
|
Foo foo;
|
|
|
|
foo.a = vec3(1.0);
|
|
|
|
foo.b = vec3(1.0);
|
|
|
|
foo.c = vec3(1.0);
|
|
|
|
vLocation4 = foo;
|
2017-03-07 15:22:47 +00:00
|
|
|
vLocation9 = 9.0;
|
|
|
|
vout.color = vec3(2.0);
|
|
|
|
vout.foo = vec3(4.0);
|
2017-03-07 12:27:04 +00:00
|
|
|
}
|