1617a3babSopenharmony_ci#version 320 es
2617a3babSopenharmony_ci
3617a3babSopenharmony_ciprecision mediump float;
4617a3babSopenharmony_ci
5617a3babSopenharmony_ciin fromVertex {
6617a3babSopenharmony_ci    in vec3 color;
7617a3babSopenharmony_ci} fromV[];
8617a3babSopenharmony_ci
9617a3babSopenharmony_ciin vec4 nonBlockUnsized[];
10617a3babSopenharmony_ci
11617a3babSopenharmony_ciout toFragment {
12617a3babSopenharmony_ci    out vec3 color;
13617a3babSopenharmony_ci} toF;
14617a3babSopenharmony_ci
15617a3babSopenharmony_ciout fromVertex {  // okay to reuse a block name for another block name
16617a3babSopenharmony_ci    vec3 color;
17617a3babSopenharmony_ci};
18617a3babSopenharmony_ci
19617a3babSopenharmony_ciout fooB {        // ERROR, cannot reuse block name as block instance
20617a3babSopenharmony_ci    vec2 color;
21617a3babSopenharmony_ci} fromVertex;
22617a3babSopenharmony_ci
23617a3babSopenharmony_ciint fromVertex;   // ERROR, cannot reuse a block name for something else
24617a3babSopenharmony_ci
25617a3babSopenharmony_ciout fooC {        // ERROR, cannot have same name for block and instance name
26617a3babSopenharmony_ci    vec2 color;
27617a3babSopenharmony_ci} fooC;
28617a3babSopenharmony_ci
29617a3babSopenharmony_civoid main()
30617a3babSopenharmony_ci{
31617a3babSopenharmony_ci    EmitVertex();
32617a3babSopenharmony_ci    EndPrimitive();
33617a3babSopenharmony_ci    EmitStreamVertex(1);    // ERROR
34617a3babSopenharmony_ci    EndStreamPrimitive(0);  // ERROR
35617a3babSopenharmony_ci
36617a3babSopenharmony_ci    color = fromV[0].color;
37617a3babSopenharmony_ci    gl_ClipDistance[3] =              // ERROR, no ClipDistance
38617a3babSopenharmony_ci        gl_in[1].gl_ClipDistance[2];  // ERROR, no ClipDistance
39617a3babSopenharmony_ci    gl_Position = gl_in[0].gl_Position;
40617a3babSopenharmony_ci
41617a3babSopenharmony_ci    gl_PrimitiveID = gl_PrimitiveIDIn;
42617a3babSopenharmony_ci    gl_Layer = 2;
43617a3babSopenharmony_ci}
44617a3babSopenharmony_ci
45617a3babSopenharmony_cilayout(stream = 4) out vec4 ov4; // ERROR, no streams
46617a3babSopenharmony_ci
47617a3babSopenharmony_cilayout(line_strip, points, triangle_strip, points, triangle_strip) out;  // just means triangle_strip"
48617a3babSopenharmony_ci
49617a3babSopenharmony_ciout ooutb { vec4 a; } ouuaa6;
50617a3babSopenharmony_ci
51617a3babSopenharmony_cilayout(max_vertices = 200) out;
52617a3babSopenharmony_cilayout(max_vertices = 300) out;   // ERROR, too big
53617a3babSopenharmony_civoid foo(layout(max_vertices = 4) int a)  // ERROR
54617a3babSopenharmony_ci{
55617a3babSopenharmony_ci    ouuaa6.a = vec4(1.0);
56617a3babSopenharmony_ci}
57617a3babSopenharmony_ci
58617a3babSopenharmony_cilayout(line_strip, points, triangle_strip, points) out;  // ERROR, changing output primitive
59617a3babSopenharmony_cilayout(line_strip, points) out; // ERROR, changing output primitive
60617a3babSopenharmony_cilayout(triangle_strip) in; // ERROR, not an input primitive
61617a3babSopenharmony_cilayout(triangle_strip) uniform; // ERROR
62617a3babSopenharmony_cilayout(triangle_strip) out vec4 badv4;  // ERROR, not on a variable
63617a3babSopenharmony_cilayout(triangle_strip) in vec4 bad2v4[];  // ERROR, not on a variable or input
64617a3babSopenharmony_cilayout(invocations = 3) out outbn { int a; }; // 2 ERROR, not on a block, not until 4.0
65617a3babSopenharmony_ciout outbn2 {
66617a3babSopenharmony_ci    layout(invocations = 3)  int a; // 2 ERRORs, not on a block member, not until 4.0
67617a3babSopenharmony_ci    layout(max_vertices = 3) int b; // ERROR, not on a block member
68617a3babSopenharmony_ci    layout(triangle_strip)   int c; // ERROR, not on a block member
69617a3babSopenharmony_ci} outbi;
70617a3babSopenharmony_ci
71617a3babSopenharmony_cilayout(lines) out;  // ERROR, not on output
72617a3babSopenharmony_cilayout(lines_adjacency) in;
73617a3babSopenharmony_cilayout(triangles) in;             // ERROR, can't change it
74617a3babSopenharmony_cilayout(triangles_adjacency) in;   // ERROR, can't change it
75617a3babSopenharmony_cilayout(invocations = 4) in;
76617a3babSopenharmony_ci
77617a3babSopenharmony_ciin sameName {
78617a3babSopenharmony_ci    int a15;
79617a3babSopenharmony_ci} insn[];
80617a3babSopenharmony_ci
81617a3babSopenharmony_ciout sameName {
82617a3babSopenharmony_ci    float f15;
83617a3babSopenharmony_ci};
84617a3babSopenharmony_ci
85617a3babSopenharmony_ciuniform sameName {
86617a3babSopenharmony_ci    bool b15;
87617a3babSopenharmony_ci};
88617a3babSopenharmony_ci
89617a3babSopenharmony_ciconst int summ = gl_MaxVertexAttribs +
90617a3babSopenharmony_ci             gl_MaxGeometryInputComponents +
91617a3babSopenharmony_ci             gl_MaxGeometryOutputComponents +
92617a3babSopenharmony_ci             gl_MaxGeometryImageUniforms +
93617a3babSopenharmony_ci             gl_MaxGeometryTextureImageUnits +
94617a3babSopenharmony_ci             gl_MaxGeometryOutputVertices +
95617a3babSopenharmony_ci             gl_MaxGeometryTotalOutputComponents +
96617a3babSopenharmony_ci             gl_MaxGeometryUniformComponents +
97617a3babSopenharmony_ci             gl_MaxGeometryAtomicCounters +
98617a3babSopenharmony_ci             gl_MaxGeometryAtomicCounterBuffers +
99617a3babSopenharmony_ci             gl_MaxVertexTextureImageUnits +
100617a3babSopenharmony_ci             gl_MaxCombinedTextureImageUnits +
101617a3babSopenharmony_ci             gl_MaxTextureImageUnits +
102617a3babSopenharmony_ci             gl_MaxDrawBuffers;
103617a3babSopenharmony_ci
104617a3babSopenharmony_civoid fooe1()
105617a3babSopenharmony_ci{
106617a3babSopenharmony_ci    gl_ViewportIndex;  // ERROR, not in ES
107617a3babSopenharmony_ci    gl_MaxViewports;   // ERROR, not in ES
108617a3babSopenharmony_ci    insn.length();     // 4: lines_adjacency
109617a3babSopenharmony_ci    int inv = gl_InvocationID;
110617a3babSopenharmony_ci}
111617a3babSopenharmony_ci
112617a3babSopenharmony_ciin vec4 explArray[4];
113617a3babSopenharmony_ciin vec4 explArrayBad[5];  // ERROR, wrong size
114617a3babSopenharmony_ciin vec4 nonArrayed;       // ERROR, not an array
115617a3babSopenharmony_ciflat out vec3 myColor1;
116617a3babSopenharmony_cicentroid out vec3 myColor2;
117617a3babSopenharmony_cicentroid in vec3 centr[];
118617a3babSopenharmony_cisample out vec4 perSampleColor;  // ERROR without sample extensions
119617a3babSopenharmony_ci
120617a3babSopenharmony_cilayout(max_vertices = 200) out;  // matching redecl
121617a3babSopenharmony_ci
122617a3babSopenharmony_cilayout(location = 7, component = 2) in float comp[];  // ERROR, es has no component
123617a3babSopenharmony_ci
124617a3babSopenharmony_civoid notHere()
125617a3babSopenharmony_ci{
126617a3babSopenharmony_ci    gl_MaxGeometryVaryingComponents;  // ERROR, not in ES
127617a3babSopenharmony_ci    gl_VerticesIn;                    // ERROR, not in ES
128617a3babSopenharmony_ci}
129617a3babSopenharmony_ci
130617a3babSopenharmony_civoid pointSize2()
131617a3babSopenharmony_ci{
132617a3babSopenharmony_ci    highp float ps = gl_in[3].gl_PointSize;  // ERROR, need extension
133617a3babSopenharmony_ci    gl_PointSize = ps;                       // ERROR, need extension
134617a3babSopenharmony_ci}
135