blob: 29c393239b364af573274212f1656425b1b02b5d [file] [log] [blame]
John Kessenich6e76bdc2015-06-19 23:03:32 +00001#version 310 es
2
3#extension GL_OES_tessellation_shader : enable
4
5layout(vertices = 4) out;
John Kessenich1be80632015-11-28 15:19:11 -07006out int outa[gl_out.length()];
John Kessenich6e76bdc2015-06-19 23:03:32 +00007
8layout(quads) in; // ERROR
9layout(ccw) out; // ERROR
10layout(fractional_even_spacing) in; // ERROR
11
12patch in vec4 patchIn; // ERROR
13patch out vec4 patchOut;
14
15void main()
16{
17 barrier();
18
19 int a = gl_MaxTessControlInputComponents +
20 gl_MaxTessControlOutputComponents +
21 gl_MaxTessControlTextureImageUnits +
22 gl_MaxTessControlUniformComponents +
23 gl_MaxTessControlTotalOutputComponents;
24
25 vec4 p = gl_in[1].gl_Position;
John Kessenichb61b8212015-06-23 04:14:00 +000026 float ps = gl_in[1].gl_PointSize; // ERROR, need point_size extension
John Kessenich6e76bdc2015-06-19 23:03:32 +000027 float cd = gl_in[1].gl_ClipDistance[2]; // ERROR, not in ES
28
29 int pvi = gl_PatchVerticesIn;
30 int pid = gl_PrimitiveID;
31 int iid = gl_InvocationID;
32
John Kessenich1be80632015-11-28 15:19:11 -070033 gl_out[gl_InvocationID].gl_Position = p;
34 gl_out[gl_InvocationID].gl_PointSize = ps; // ERROR, need point_size extension
35 gl_out[gl_InvocationID].gl_ClipDistance[1] = cd; // ERROR, not in ES
John Kessenich6e76bdc2015-06-19 23:03:32 +000036
37 gl_TessLevelOuter[3] = 3.2;
38 gl_TessLevelInner[1] = 1.3;
39
40 if (a > 10)
41 barrier(); // ERROR
42 else
43 barrier(); // ERROR
44
45 barrier();
46
47 do {
48 barrier(); // ERROR
49 } while (a > 10);
50
51 switch (a) {
52 default:
53 barrier(); // ERROR
54 break;
55 }
56 a < 12 ? a : (barrier(), a); // ERROR
57 {
58 barrier();
59 }
60
61 return;
62
63 barrier(); // ERROR
64}
65
66layout(vertices = 4) in; // ERROR, not on in
67layout(vertices = 5) out; // ERROR, changing #
68
69void foo()
70{
71 gl_out[4].gl_Position; // ERROR, out of range
72
73 barrier(); // ERROR, not in main
74}
75
76in vec2 ina; // ERROR, not array
77in vec2 inb[];
78in vec2 inc[18]; // ERROR, wrong size
79in vec2 ind[gl_MaxPatchVertices];
80patch out float implA[]; // ERROR, not sized
81
82#extension GL_ARB_separate_shader_objects : enable
83
84layout(location = 3) in vec4 ivla[];
85layout(location = 4) in vec4 ivlb[];
86layout(location = 4) in vec4 ivlc[]; // ERROR, overlapping
87
88layout(location = 3) out vec4 ovla[];
89layout(location = 4) out vec4 ovlb[];
90layout(location = 4) out vec4 ovlc[]; // ERROR, overlapping
91
92void foop()
93{
94 precise float d; // ERROR without gpu_shader5
95 d = fma(d, d, d); // ERROR without gpu_shader5
96}
97
98patch out pinbn {
99 int a;
100} pinbi;
101
102centroid out vec3 myColor2[];
103centroid in vec3 centr[];
104sample out vec4 perSampleColor[]; // ERROR without sample extensions
105
106layout(vertices = 4) out float badlay[]; // ERROR, not on a variable
107out float misSized[5]; // ERROR, size doesn't match
108out float okaySize[4];
109
John Kessenichb61b8212015-06-23 04:14:00 +0000110#extension GL_OES_tessellation_point_size : enable
111
112void pointSize2()
113{
114 float ps = gl_in[1].gl_PointSize;
John Kessenich1be80632015-11-28 15:19:11 -0700115 gl_out[gl_InvocationID].gl_PointSize = ps;
John Kessenichb61b8212015-06-23 04:14:00 +0000116}
117
John Kessenichf5b2c062015-08-18 01:35:08 -0600118#extension GL_OES_gpu_shader5 : enable
119
120precise vec3 pv3;
121
122void goodfoop()
123{
124 precise float d;
125
126 pv3 *= pv3;
127 pv3 = fma(pv3, pv3, pv3);
128 d = fma(d, d, d);
129}
John Kessenich30314592015-08-16 11:38:07 -0600130
131void bbBad()
132{
133 gl_BoundingBoxOES; // ERROR without GL_OES_primitive_bounding_box
134}
135
136#extension GL_OES_primitive_bounding_box : enable
137
138void bb()
139{
140 gl_BoundingBoxOES[0] = vec4(0.0);
141 gl_BoundingBoxOES[1] = vec4(1.0);
142 gl_BoundingBoxOES[2] = vec4(2.0); // ERROR, overflow
143}
John Kessenich1be80632015-11-28 15:19:11 -0700144
145out patch badpatchBName { // ERROR, array size required
146 float f;
147} badpatchIName[];
148
149out patch patchBName {
150 float f;
151} patchIName[4];
152
153void outputtingOutparam(out int a)
154{
155 a = 2;
156}
157
158void outputting()
159{
160 outa[gl_InvocationID] = 2;
161 outa[1] = 2; // ERROR, not gl_InvocationID
162 gl_out[0].gl_Position = vec4(1.0); // ERROR, not gl_InvocationID
163 outa[1];
164 gl_out[0];
165 outputtingOutparam(outa[0]); // ERROR, not gl_InvocationID
166 outputtingOutparam(outa[gl_InvocationID]);
167 patchIName[1].f = 3.14;
168 outa[(gl_InvocationID)] = 2;
169}