SPIRV-Cross/shaders/flatten/swizzle.flatten.vert

48 lines
959 B
GLSL
Raw Normal View History

2017-01-16 22:19:49 +00:00
#version 310 es
// comments note the 16b alignment boundaries (see GL spec 7.6.2.2 Standard Uniform Block Layout)
layout(std140, binding = 0) uniform UBO
2017-01-16 22:19:49 +00:00
{
// 16b boundary
2017-01-21 11:39:16 +00:00
vec4 A;
2017-01-16 22:19:49 +00:00
// 16b boundary
2017-01-21 11:39:16 +00:00
vec2 B0;
vec2 B1;
2017-01-16 22:19:49 +00:00
// 16b boundary
2017-01-21 11:39:16 +00:00
float C0;
2017-01-16 22:19:49 +00:00
// 16b boundary (vec3 is aligned to 16b)
2017-01-21 11:39:16 +00:00
vec3 C1;
2017-01-16 22:19:49 +00:00
// 16b boundary
2017-01-21 11:39:16 +00:00
vec3 D0;
float D1;
2017-01-16 22:19:49 +00:00
// 16b boundary
2017-01-21 11:39:16 +00:00
float E0;
float E1;
float E2;
float E3;
2017-01-16 22:19:49 +00:00
// 16b boundary
2017-01-21 11:39:16 +00:00
float F0;
vec2 F1;
2017-01-16 22:19:49 +00:00
// 16b boundary (vec2 before us is aligned to 8b)
2017-01-21 11:39:16 +00:00
float F2;
2017-01-16 22:19:49 +00:00
};
layout(location = 0) out vec4 oA;
layout(location = 1) out vec4 oB;
layout(location = 2) out vec4 oC;
layout(location = 3) out vec4 oD;
layout(location = 4) out vec4 oE;
layout(location = 5) out vec4 oF;
2017-01-16 22:19:49 +00:00
void main()
{
gl_Position = vec4(0.0);
oA = A;
oB = vec4(B0, B1);
oC = vec4(C0, C1);
oD = vec4(D0, D1);
oE = vec4(E0, E1, E2, E3);
oF = vec4(F0, F1, F2);
}