• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1group invalid_declarations "Invalid declarations"
2	case in_in_vertex_main
3		version 300 es
4		expect compile_fail
5		vertex ""
6			#version 300 es
7			${VERTEX_DECLARATIONS}
8			void main()
9			{
10				in mediump float val;
11				gl_Position = vec4(1.0);
12			}
13		""
14		fragment ""
15			#version 300 es
16			${FRAGMENT_DECLARATIONS}
17			void main()
18			{
19				${FRAG_COLOR} = vec4(1.0);
20			}
21		""
22	end
23
24	case out_in_vertex_main
25		version 300 es
26		expect compile_fail
27		vertex ""
28			#version 300 es
29			${VERTEX_DECLARATIONS}
30			void main()
31			{
32				out mediump float val;
33				gl_Position = vec4(1.0);
34			}
35		""
36		fragment ""
37			#version 300 es
38			in mediump float val;
39			${FRAGMENT_DECLARATIONS}
40			void main()
41			{
42				${FRAG_COLOR} = vec4(1.0);
43			}
44		""
45	end
46
47	case in_in_fragment_main
48		version 300 es
49		expect compile_fail
50		vertex ""
51			#version 300 es
52			out mediump float val;
53			${VERTEX_DECLARATIONS}
54			void main()
55			{
56				gl_Position = vec4(1.0);
57			}
58		""
59		fragment ""
60			#version 300 es
61			${FRAGMENT_DECLARATIONS}
62			void main()
63			{
64				in mediump float val;
65				${FRAG_COLOR} = vec4(1.0);
66			}
67		""
68	end
69
70	case out_in_fragment_main
71		version 300 es
72		expect compile_fail
73		vertex ""
74			#version 300 es
75			${VERTEX_DECLARATIONS}
76			void main()
77			{
78				gl_Position = vec4(1.0);
79			}
80		""
81		fragment ""
82			#version 300 es
83			${FRAGMENT_DECLARATIONS}
84			void main()
85			{
86				out mediump float val;
87				${FRAG_COLOR} = vec4(1.0);
88			}
89		""
90	end
91
92	case uniform_in_vertex_main
93		version 300 es
94		expect compile_fail
95		vertex ""
96			#version 300 es
97			${VERTEX_DECLARATIONS}
98			void main()
99			{
100				uniform mediump float val;
101				gl_Position = vec4(1.0);
102			}
103		""
104		fragment ""
105			#version 300 es
106			${FRAGMENT_DECLARATIONS}
107			void main()
108			{
109				${FRAG_COLOR} = vec4(1.0);
110			}
111		""
112	end
113
114	case uniform_in_fragment_main
115		version 300 es
116		expect compile_fail
117		vertex ""
118			#version 300 es
119			${VERTEX_DECLARATIONS}
120			void main()
121			{
122				gl_Position = vec4(1.0);
123			}
124		""
125		fragment ""
126			#version 300 es
127			${FRAGMENT_DECLARATIONS}
128			void main()
129			{
130				uniform mediump float val;
131				${FRAG_COLOR} = vec4(1.0);
132			}
133		""
134	end
135
136	case uniform_block_in_main
137		version 300 es
138		expect compile_fail
139		both ""
140			#version 300 es
141			${DECLARATIONS}
142			void main()
143			{
144				uniform Block { mediump float val; };
145				${OUTPUT}
146			}
147		""
148	end
149
150	case invariant_attribute
151		version 300 es
152		expect compile_fail
153		vertex ""
154			#version 300 es
155			invariant in mediump float val;
156			${VERTEX_DECLARATIONS}
157			void main()
158			{
159				gl_Position = vec4(1.0);
160			}
161		""
162		fragment ""
163			#version 300 es
164			${FRAGMENT_DECLARATIONS}
165			void main()
166			{
167				${FRAG_COLOR} = vec4(1.0);
168			}
169		""
170	end
171
172	case invariant_uniform
173		version 300 es
174		expect compile_fail
175		vertex ""
176			#version 300 es
177			invariant uniform mediump float val;
178			${VERTEX_DECLARATIONS}
179			void main()
180			{
181				gl_Position = vec4(1.0);
182			}
183		""
184		fragment ""
185			#version 300 es
186			${FRAGMENT_DECLARATIONS}
187			void main()
188			{
189				${FRAG_COLOR} = vec4(1.0);
190			}
191		""
192	end
193
194	case invariant_uniform_block_1
195		version 300 es
196		expect compile_fail
197		both ""
198			#version 300 es
199			invariant uniform Block { mediump float val; };
200			${DECLARATIONS}
201			void main()
202			{
203				${OUTPUT}
204			}
205		""
206	end
207
208	case invariant_uniform_block_2
209		version 300 es
210		expect compile_fail
211		both ""
212			#version 300 es
213			uniform Block { invariant mediump float val; };
214			${DECLARATIONS}
215			void main()
216			{
217				${OUTPUT}
218			}
219		""
220	end
221
222	case uniform_block_layout_qualifier
223		version 300 es
224		expect compile_fail
225		both ""
226			#version 300 es
227			layout(foobar) uniform Block
228			{
229				mediump float val;
230			};
231			${DECLARATIONS}
232			void main()
233			{
234				${OUTPUT}
235			}
236		""
237	end
238
239	case uniform_block_member_layout_qualifier
240		version 300 es
241		expect compile_fail
242		both ""
243			#version 300 es
244			${DECLARATIONS}
245			uniform Block
246			{
247				layout(foobar) uniform mediump float val;
248			};
249			void main()
250			{
251				${OUTPUT}
252			}
253		""
254	end
255
256	case uniform_block_nested_struct_definition
257		version 300 es
258		expect compile_fail
259		both ""
260			#version 300 es
261			${DECLARATIONS}
262			uniform Block
263			{
264				struct S
265				{
266					mediump float v;
267					struct T
268					{
269						highp int i;
270					} t;
271				} s;
272			};
273			void main()
274			{
275				${OUTPUT}
276			}
277		""
278	end
279
280	case nested_uniform_block
281		version 300 es
282		expect compile_fail
283		both ""
284			#version 300 es
285			${DECLARATIONS}
286			uniform Block
287			{
288				uniform Block2
289				{
290					mediump float v;
291				} block2;
292			} block;
293			void main()
294			{
295				${OUTPUT}
296			}
297		""
298	end
299
300	case uniform_block_sampler_2d
301		version 300 es
302		expect compile_fail
303		both ""
304			#version 300 es
305			${DECLARATIONS}
306			uniform Block
307			{
308				uniform sampler2D s;
309			};
310			void main()
311			{
312				${OUTPUT}
313			}
314		""
315	end
316
317	case uniform_block_sampler_cube
318		version 300 es
319		expect compile_fail
320		both ""
321			#version 300 es
322			${DECLARATIONS}
323			uniform Block
324			{
325				uniform samplerCube s;
326			};
327			void main()
328			{
329				${OUTPUT}
330			}
331		""
332	end
333
334	case uniform_block_missing_member_semicolon
335		version 300 es
336		expect compile_fail
337		both ""
338			#version 300 es
339			${DECLARATIONS}
340			uniform Block
341			{
342				mediump float var
343			};
344			void main()
345			{
346				${OUTPUT}
347			}
348		""
349	end
350
351	case uniform_block_missing_end_semicolon
352		version 300 es
353		expect compile_fail
354		both ""
355			#version 300 es
356			${DECLARATIONS}
357			uniform Block
358			{
359				mediump float var;
360			}
361			void main()
362			{
363				${OUTPUT}
364			}
365		""
366	end
367
368	case uniform_block_duplicate_member_name_1
369		version 300 es
370		expect compile_fail
371		both ""
372			#version 300 es
373			${DECLARATIONS}
374			uniform Block
375			{
376				mediump float var;
377				mediump float var;
378			};
379			void main()
380			{
381				${OUTPUT}
382			}
383		""
384	end
385
386	case uniform_block_duplicate_member_name_2
387		version 300 es
388		expect compile_fail
389		both ""
390			#version 300 es
391			${DECLARATIONS}
392			uniform Block
393			{
394				mediump float var;
395			};
396			uniform Block2
397			{
398				mediump float var;
399			};
400			void main()
401			{
402				${OUTPUT}
403			}
404		""
405	end
406
407	case uniform_block_duplicate_member_name_3
408		version 300 es
409		expect compile_fail
410		both ""
411			#version 300 es
412			${DECLARATIONS}
413			uniform mediump float var;
414			uniform Block
415			{
416				mediump float var;
417			};
418			void main()
419			{
420				${OUTPUT}
421			}
422		""
423	end
424
425	case uniform_block_duplicate_block_name
426		version 300 es
427		expect compile_fail
428		both ""
429			#version 300 es
430			${DECLARATIONS}
431			uniform Block
432			{
433				mediump float var;
434			};
435			uniform Block
436			{
437				mediump float var2;
438			};
439			void main()
440			{
441				${OUTPUT}
442			}
443		""
444	end
445
446	case uniform_block_duplicate_instance_name_1
447		version 300 es
448		expect compile_fail
449		both ""
450			#version 300 es
451			${DECLARATIONS}
452			uniform Block
453			{
454				mediump float var;
455			} block;
456			uniform Block2
457			{
458				mediump float var2;
459			} block;
460			void main()
461			{
462				${OUTPUT}
463			}
464		""
465	end
466
467	case uniform_block_duplicate_instance_name_2
468		version 300 es
469		expect compile_fail
470		both ""
471			#version 300 es
472			${DECLARATIONS}
473			uniform mediump float block;
474			uniform Block
475			{
476				mediump float var;
477			} block;
478			void main()
479			{
480				${OUTPUT}
481			}
482		""
483	end
484
485	case uniform_block_duplicate_instance_name_3
486		version 300 es
487		expect compile_fail
488		both ""
489			#version 300 es
490			${DECLARATIONS}
491			uniform Block
492			{
493				mediump float block;
494			};
495			uniform Block2
496			{
497				mediump float var2;
498			} block;
499			void main()
500			{
501				${OUTPUT}
502			}
503		""
504	end
505
506	case uniform_block_array_without_instance_name_1
507		version 300 es
508		expect compile_fail
509		both ""
510			#version 300 es
511			${DECLARATIONS}
512			uniform Block[2]
513			{
514				mediump float var;
515			};
516			void main()
517			{
518				${OUTPUT}
519			}
520		""
521	end
522
523	case uniform_block_array_without_instance_name_2
524		version 300 es
525		expect compile_fail
526		both ""
527			#version 300 es
528			${DECLARATIONS}
529			uniform Block
530			{
531				mediump float var;
532			} [2];
533			void main()
534			{
535				${OUTPUT}
536			}
537		""
538	end
539
540	case uniform_block_in
541		version 300 es
542		expect compile_fail
543		both ""
544			#version 300 es
545			${DECLARATIONS}
546			uniform Block
547			{
548				in mediump float var;
549			};
550			void main()
551			{
552				${OUTPUT}
553			}
554		""
555	end
556
557	case uniform_block_out
558		version 300 es
559		expect compile_fail
560		both ""
561			#version 300 es
562			${DECLARATIONS}
563			uniform Block
564			{
565				out mediump float var;
566			};
567			void main()
568			{
569				${OUTPUT}
570			}
571		""
572	end
573
574	case uniform_block_const
575		version 300 es
576		expect compile_fail
577		both ""
578			#version 300 es
579			${DECLARATIONS}
580			uniform Block
581			{
582				const mediump float var;
583			};
584			void main()
585			{
586				${OUTPUT}
587			}
588		""
589	end
590
591end # invalid_declarations
592