• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#version 430
2
3layout (triangles) in;
4layout (triangle_strip, max_vertices = 3) out;
5
6// OK: different instance names is allowed
7layout (std140, binding = 1) uniform ColorBlock
8{
9	vec4 color1;
10	bool b;
11	vec4 color2;
12	vec4 color3;
13} uColor;
14
15// OK: different instance names is allowed
16layout (std430, binding = 1) buffer BufferBlock
17{
18	mat4 p;
19} uBuffer;
20
21// OK: different instance names is allowed
22layout (std140, binding = 0) uniform MatrixBlock
23{
24	mat4 uProj;
25	mat4 uWorld;
26} uMatrix;
27
28// OK, it's allowed for input/output interfaces to
29// be anonymous is one unit and not in another
30out Vertex
31{
32	vec4 val1;
33};
34
35in Vertex
36{
37	vec4 v1;
38	vec4 v2;
39} iVV[];
40
41
42in vec4 P[3];
43
44vec4 getColor2()
45{
46	return uColor.color2;
47}
48
49vec4 getWorld(int i)
50{
51	val1 = vec4(1);
52	return uMatrix.uWorld * iVV[i].v1;
53}
54
55