blob: 9811b08617ed2a215a71e5a639afe32b5fab5bf0 [file] [log] [blame]
Malcolm Bechard0b66fa32020-04-02 04:03:53 -04001#version 430
2
3layout (triangles) in;
4layout (triangle_strip, max_vertices = 3) out;
5
6// OK: different instance names is allowed
7layout (std140, binding = 0) uniform MatrixBlock
8{
9 mat4 uProj;
10 mat4 uWorld;
11} uM;
12
13// Verify that in/out blocks with same block name work
14in Vertex
15{
16 vec4 v1;
17 vec4 v2;
18} iV[3];
19
20out Vertex
21{
22 vec4 val1;
23} oV;
24
25// OK: different instance names is allowed
26layout (std140, binding = 1) uniform ColorBlock
27{
28 vec4 color1;
29 bool b;
30 vec4 color2;
31 vec4 color3;
32} uC;
33
34// OK: different instance names is allowed
35layout (std430, binding = 1) buffer BufferBlock
36{
37 mat4 p;
38} uBuf;
39
40vec4 getWorld(int i);
41vec4 getColor2();
42
43out vec4 oColor;
44
45float globalF;
46
47void
48main()
49{
50 oColor = uC.color1 * getColor2();
51
52 globalF = 1.0;
53
54 for (int i = 0; i < 3; i++)
55 {
56 gl_Position = uM.uProj * getWorld(i);
57 oV.val1 = uC.color1 + iV[i].v2 * globalF;
58 EmitVertex();
59 }
60
61 EndPrimitive();
62}