• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#version 310 es
2
3#extension GL_EXT_tessellation_shader : enable
4#extension GL_OES_tessellation_shader : enable
5#extension GL_EXT_tessellation_shader : disable
6
7layout(vertices = 4) out; // ERROR
8layout(quads, cw) in;
9layout(triangles) in;     // ERROR
10layout(isolines) in;      // ERROR
11
12layout(ccw) in;           // ERROR
13layout(cw) in;
14
15layout(fractional_odd_spacing) in;
16layout(equal_spacing) in;              // ERROR
17layout(fractional_even_spacing) in;    // ERROR
18
19layout(point_mode) in;
20
21patch in vec4 patchIn;
22patch out vec4 patchOut;  // ERROR
23
24void main()
25{
26    barrier(); // ERROR
27
28    int a = gl_MaxTessEvaluationInputComponents +
29            gl_MaxTessEvaluationOutputComponents +
30            gl_MaxTessEvaluationTextureImageUnits +
31            gl_MaxTessEvaluationUniformComponents +
32            gl_MaxTessPatchComponents +
33            gl_MaxPatchVertices +
34            gl_MaxTessGenLevel;
35
36    vec4 p = gl_in[1].gl_Position;
37    float ps = gl_in[1].gl_PointSize;        // ERROR, need point_size extension
38    float cd = gl_in[1].gl_ClipDistance[2];  // ERROR, not in ES
39
40    int pvi = gl_PatchVerticesIn;
41    int pid = gl_PrimitiveID;
42    vec3 tc = gl_TessCoord;
43    float tlo = gl_TessLevelOuter[3];
44    float tli = gl_TessLevelInner[1];
45
46    gl_Position = p;
47    gl_PointSize = ps;             // ERROR, need point_size extension
48    gl_ClipDistance[2] = cd;       // ERROR, not in ES
49}
50
51smooth patch in vec4 badp1;         // ERROR
52flat patch in vec4 badp2;           // ERROR
53noperspective patch in vec4 badp3;  // ERROR
54patch sample in vec3 badp4;         // ERROR
55
56#extension GL_ARB_separate_shader_objects : enable
57
58in gl_PerVertex
59{
60    vec4 gl_Position;
61} gl_in[];
62
63in gl_PerVertex           // ERROR, second redeclaration of gl_in
64{
65    vec4 gl_Position;
66} gl_in[];
67
68layout(quads, cw) out;     // ERROR
69layout(triangles) out;     // ERROR
70layout(isolines) out;      // ERROR
71layout(cw) out;            // ERROR
72layout(fractional_odd_spacing) out;    // ERROR
73layout(equal_spacing) out;             // ERROR
74layout(fractional_even_spacing) out;   // ERROR
75layout(point_mode) out;                // ERROR
76
77in vec2 ina;      // ERROR, not array
78in vec2 inb[];
79in vec2 inc[18];  // ERROR, wrong size
80in vec2 ind[gl_MaxPatchVertices];
81
82in testbla {      // ERROR, not array
83    int f;
84} bla;
85
86in testblb {
87    int f;
88} blb[];
89
90in testblc { // ERROR wrong size
91    int f;
92} blc[18];
93
94in testbld {
95    int f;
96} bld[gl_MaxPatchVertices];
97
98layout(location = 23) in vec4 ivla[];
99layout(location = 24) in vec4 ivlb[];
100layout(location = 24) in vec4 ivlc[];  // ERROR, overlap
101
102layout(location = 23) out vec4 ovla[2];
103layout(location = 24) out vec4 ovlb[2];  // ERROR, overlap
104
105in float gl_TessLevelOuter[4];           // ERROR, can't redeclare
106
107patch in pinbn {
108    int a;
109} pinbi;
110
111centroid out vec3 myColor2;
112centroid in vec3 centr[];
113sample out vec4 perSampleColor;  // ERROR without sample extensions
114
115#extension GL_OES_tessellation_point_size : enable
116
117void pointSize2()
118{
119    float ps = gl_in[1].gl_PointSize;  // ERROR, not in the redeclaration, but no error on use of gl_PointSize
120    gl_PointSize = ps;
121}
122
123#extension GL_EXT_primitive_bounding_box : enable
124
125void bbbad()
126{
127    gl_BoundingBoxOES; // ERROR, wrong stage
128}
129