• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#version 430
2
3// OK: different instance names is allowed in other unit
4layout (std140, binding = 0) uniform MatrixBlock
5{
6	mat4 uProj;
7	mat4 uWorld;
8} uM;
9
10// OK: other unit has it as anonymous, but that is allowed
11out Vertex
12{
13	vec4 v1;
14	vec4 v2;
15} oV;
16
17// OK: different instance names is allowed in other unit
18layout (std140, binding = 1) uniform ColorBlock
19{
20	vec4 color1;
21	bool b;
22	vec4 color2;
23	vec4 color3;
24} uC;
25
26// OK: different instance names is allowed in other unit
27layout (std430, binding = 1) buffer BufferBlock
28{
29	mat4 p;
30} uBuf;
31
32layout (std430, binding = 0) buffer SecondaryColorBlock
33{
34	vec4 c;
35} uColorBuf;
36
37vec4 getWorld();
38vec4 getColor2();
39
40out vec4 oColor;
41
42void
43main()
44{
45	oColor = uC.color1 * getColor2() * uColorBuf.c;
46	oV.v1 = uC.color1;
47
48	gl_Position = uM.uProj * getWorld();
49}
50