Merge pull request #3031 from rg3igalia/sub-group-size-arb-flat-fix
[platform/upstream/glslang.git] / Test / 320.geom
1 #version 320 es\r
2 \r
3 precision mediump float;\r
4 \r
5 in fromVertex {\r
6     in vec3 color;\r
7 } fromV[];\r
8 \r
9 in vec4 nonBlockUnsized[];\r
10 \r
11 out toFragment {\r
12     out vec3 color;\r
13 } toF;\r
14 \r
15 out fromVertex {  // okay to reuse a block name for another block name\r
16     vec3 color;\r
17 };\r
18 \r
19 out fooB {        // ERROR, cannot reuse block name as block instance\r
20     vec2 color;\r
21 } fromVertex;\r
22 \r
23 int fromVertex;   // ERROR, cannot reuse a block name for something else\r
24 \r
25 out fooC {        // ERROR, cannot have same name for block and instance name\r
26     vec2 color;\r
27 } fooC;\r
28 \r
29 void main()\r
30 {\r
31     EmitVertex();\r
32     EndPrimitive();\r
33     EmitStreamVertex(1);    // ERROR\r
34     EndStreamPrimitive(0);  // ERROR\r
35 \r
36     color = fromV[0].color;\r
37     gl_ClipDistance[3] =              // ERROR, no ClipDistance\r
38         gl_in[1].gl_ClipDistance[2];  // ERROR, no ClipDistance\r
39     gl_Position = gl_in[0].gl_Position;\r
40 \r
41     gl_PrimitiveID = gl_PrimitiveIDIn;\r
42     gl_Layer = 2;\r
43 }\r
44 \r
45 layout(stream = 4) out vec4 ov4; // ERROR, no streams\r
46 \r
47 layout(line_strip, points, triangle_strip, points, triangle_strip) out;  // just means triangle_strip"\r
48 \r
49 out ooutb { vec4 a; } ouuaa6;\r
50 \r
51 layout(max_vertices = 200) out;\r
52 layout(max_vertices = 300) out;   // ERROR, too big\r
53 void foo(layout(max_vertices = 4) int a)  // ERROR\r
54 {\r
55     ouuaa6.a = vec4(1.0);\r
56 }\r
57 \r
58 layout(line_strip, points, triangle_strip, points) out;  // ERROR, changing output primitive\r
59 layout(line_strip, points) out; // ERROR, changing output primitive\r
60 layout(triangle_strip) in; // ERROR, not an input primitive\r
61 layout(triangle_strip) uniform; // ERROR\r
62 layout(triangle_strip) out vec4 badv4;  // ERROR, not on a variable\r
63 layout(triangle_strip) in vec4 bad2v4[];  // ERROR, not on a variable or input\r
64 layout(invocations = 3) out outbn { int a; }; // 2 ERROR, not on a block, not until 4.0\r
65 out outbn2 {\r
66     layout(invocations = 3)  int a; // 2 ERRORs, not on a block member, not until 4.0\r
67     layout(max_vertices = 3) int b; // ERROR, not on a block member\r
68     layout(triangle_strip)   int c; // ERROR, not on a block member\r
69 } outbi;\r
70 \r
71 layout(lines) out;  // ERROR, not on output\r
72 layout(lines_adjacency) in;\r
73 layout(triangles) in;             // ERROR, can't change it\r
74 layout(triangles_adjacency) in;   // ERROR, can't change it\r
75 layout(invocations = 4) in;\r
76 \r
77 in sameName {\r
78     int a15;\r
79 } insn[];\r
80 \r
81 out sameName {\r
82     float f15;\r
83 };\r
84 \r
85 uniform sameName {\r
86     bool b15;\r
87 };\r
88 \r
89 const int summ = gl_MaxVertexAttribs +\r
90              gl_MaxGeometryInputComponents +\r
91              gl_MaxGeometryOutputComponents +\r
92              gl_MaxGeometryImageUniforms +\r
93              gl_MaxGeometryTextureImageUnits +\r
94              gl_MaxGeometryOutputVertices +\r
95              gl_MaxGeometryTotalOutputComponents +\r
96              gl_MaxGeometryUniformComponents +\r
97              gl_MaxGeometryAtomicCounters +\r
98              gl_MaxGeometryAtomicCounterBuffers +\r
99              gl_MaxVertexTextureImageUnits +\r
100              gl_MaxCombinedTextureImageUnits +\r
101              gl_MaxTextureImageUnits +\r
102              gl_MaxDrawBuffers;\r
103 \r
104 void fooe1()\r
105 {\r
106     gl_ViewportIndex;  // ERROR, not in ES\r
107     gl_MaxViewports;   // ERROR, not in ES\r
108     insn.length();     // 4: lines_adjacency\r
109     int inv = gl_InvocationID;\r
110 }\r
111 \r
112 in vec4 explArray[4];\r
113 in vec4 explArrayBad[5];  // ERROR, wrong size\r
114 in vec4 nonArrayed;       // ERROR, not an array\r
115 flat out vec3 myColor1;\r
116 centroid out vec3 myColor2;\r
117 centroid in vec3 centr[];\r
118 sample out vec4 perSampleColor;  // ERROR without sample extensions\r
119 \r
120 layout(max_vertices = 200) out;  // matching redecl\r
121 \r
122 layout(location = 7, component = 2) in float comp[];  // ERROR, es has no component\r
123 \r
124 void notHere()\r
125 {\r
126     gl_MaxGeometryVaryingComponents;  // ERROR, not in ES\r
127     gl_VerticesIn;                    // ERROR, not in ES\r
128 }\r
129 \r
130 void pointSize2()\r
131 {\r
132     highp float ps = gl_in[3].gl_PointSize;  // ERROR, need extension\r
133     gl_PointSize = ps;                       // ERROR, need extension\r
134 }\r