xref: /aosp_15_r20/external/deqp/data/gles31/shaders/gl45/linkage_tessellation.test (revision 35238bce31c2a825756842865a792f8cf7f89930)
1# -------------------------------------------------
2# drawElements Quality Program OpenGL ES 3.2 Module
3# -------------------------------------------------
4#
5# Copyright 2016 The Android Open Source Project
6#
7# Licensed under the Apache License, Version 2.0 (the "License");
8# you may not use this file except in compliance with the License.
9# You may obtain a copy of the License at
10#
11#      http://www.apache.org/licenses/LICENSE-2.0
12#
13# Unless required by applicable law or agreed to in writing, software
14# distributed under the License is distributed on an "AS IS" BASIS,
15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16# See the License for the specific language governing permissions and
17# limitations under the License.
18
19
20group varying "Varying linkage"
21    group rules "Rules"
22
23        case input_type_mismatch
24            version 450
25            desc "Tessellation control shader input type mismatch"
26            expect link_fail
27            values
28            {
29                input float in0 = 1.0;
30                output float out0 = 1.0;
31            }
32            vertex ""
33                #version 450
34                ${VERTEX_DECLARATIONS}
35                out mediump float tc_in;
36                void main()
37                {
38                    tc_in = in0;
39                    ${VERTEX_OUTPUT}
40                }
41            ""
42            tessellation_control ""
43                #version 450
44                ${TESSELLATION_CONTROL_DECLARATIONS}
45                in mediump vec2 tc_in[];
46                out mediump float tc_out[];
47                void main()
48                {
49                    tc_out[gl_InvocationID] = tc_in[gl_InvocationID].x;
50                    ${TESSELLATION_CONTROL_OUTPUT}
51                }
52            ""
53            tessellation_evaluation ""
54                #version 450
55                ${TESSELLATION_EVALUATION_DECLARATIONS}
56                in mediump float tc_out[];
57                out mediump float te_out;
58                void main()
59                {
60                    te_out = tc_out[2];
61                    ${TESSELLATION_EVALUATION_OUTPUT}
62                }
63            ""
64            fragment ""
65                #version 450
66                precision mediump float;
67                ${FRAGMENT_DECLARATIONS}
68                in mediump float te_out;
69                void main()
70                {
71                    out0 = te_out;
72                    ${FRAGMENT_OUTPUT}
73                }
74            ""
75        end
76
77        case output_type_mismatch
78            version 450
79            desc "Tessellation evaluation shader output type mismatch"
80            expect link_fail
81            values
82            {
83                input float in0 = 1.0;
84                output float out0 = 1.0;
85            }
86            vertex ""
87                #version 450
88                ${VERTEX_DECLARATIONS}
89                out mediump float tc_in;
90                void main()
91                {
92                    tc_in = in0;
93                    ${VERTEX_OUTPUT}
94                }
95            ""
96            tessellation_control ""
97                #version 450
98                ${TESSELLATION_CONTROL_DECLARATIONS}
99                in mediump float tc_in[];
100                out mediump float tc_out[];
101                void main()
102                {
103                    tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
104                    ${TESSELLATION_CONTROL_OUTPUT}
105                }
106            ""
107            tessellation_evaluation ""
108                #version 450
109                ${TESSELLATION_EVALUATION_DECLARATIONS}
110                in mediump float tc_out[];
111                out mediump float te_out;
112                void main()
113                {
114                    te_out = tc_out[2];
115                    ${TESSELLATION_EVALUATION_OUTPUT}
116                }
117            ""
118            fragment ""
119                #version 450
120                precision mediump float;
121                ${FRAGMENT_DECLARATIONS}
122                in mediump vec2 te_out;
123                void main()
124                {
125                    out0 = te_out.x + te_out.y;
126                    ${FRAGMENT_OUTPUT}
127                }
128            ""
129        end
130
131        case input_different_precision
132            version 450
133            desc "Tessellation control shader input precisions different"
134            values
135            {
136                input float in0 = 1.0;
137                output float out0 = 1.0;
138            }
139            vertex ""
140                #version 450
141                ${VERTEX_DECLARATIONS}
142                out highp float tc_in;
143                void main()
144                {
145                    tc_in = in0;
146                    ${VERTEX_OUTPUT}
147                }
148            ""
149            tessellation_control ""
150                #version 450
151                ${TESSELLATION_CONTROL_DECLARATIONS}
152                in lowp float tc_in[];
153                out mediump float tc_out[];
154                void main()
155                {
156                    tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
157                    ${TESSELLATION_CONTROL_OUTPUT}
158                }
159            ""
160            tessellation_evaluation ""
161                #version 450
162                ${TESSELLATION_EVALUATION_DECLARATIONS}
163                in mediump float tc_out[];
164                out mediump float te_out;
165                void main()
166                {
167                    te_out = tc_out[2];
168                    ${TESSELLATION_EVALUATION_OUTPUT}
169                }
170            ""
171            fragment ""
172                #version 450
173                precision mediump float;
174                ${FRAGMENT_DECLARATIONS}
175                in mediump float te_out;
176                void main()
177                {
178                    out0 = te_out;
179                    ${FRAGMENT_OUTPUT}
180                }
181            ""
182        end
183
184        case output_different_precision
185            version 450
186            desc "Tessellation evaluation shader output precisions different"
187            values
188            {
189                input float in0 = 1.0;
190                output float out0 = 1.0;
191            }
192            vertex ""
193                #version 450
194                ${VERTEX_DECLARATIONS}
195                out mediump float tc_in;
196                void main()
197                {
198                    tc_in = in0;
199                    ${VERTEX_OUTPUT}
200                }
201            ""
202            tessellation_control ""
203                #version 450
204                ${TESSELLATION_CONTROL_DECLARATIONS}
205                in mediump float tc_in[];
206                out mediump float tc_out[];
207                void main()
208                {
209                    tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
210                    ${TESSELLATION_CONTROL_OUTPUT}
211                }
212            ""
213            tessellation_evaluation ""
214                #version 450
215                ${TESSELLATION_EVALUATION_DECLARATIONS}
216                in mediump float tc_out[];
217                out highp float te_out;
218                void main()
219                {
220                    te_out = tc_out[2];
221                    ${TESSELLATION_EVALUATION_OUTPUT}
222                }
223            ""
224            fragment ""
225                #version 450
226                precision mediump float;
227                ${FRAGMENT_DECLARATIONS}
228                in lowp float te_out;
229                void main()
230                {
231                    out0 = te_out;
232                    ${FRAGMENT_OUTPUT}
233                }
234            ""
235        end
236
237        case internal_different_precision
238            version 450
239            desc "Tessellation control and evaluation shader varying precisions different"
240            values
241            {
242                input float in0 = 1.0;
243                output float out0 = 1.0;
244            }
245            vertex ""
246                #version 450
247                ${VERTEX_DECLARATIONS}
248                out mediump float tc_in;
249                void main()
250                {
251                    tc_in = in0;
252                    ${VERTEX_OUTPUT}
253                }
254            ""
255            tessellation_control ""
256                #version 450
257                ${TESSELLATION_CONTROL_DECLARATIONS}
258                in mediump float tc_in[];
259                out highp float tc_out[];
260                void main()
261                {
262                    tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
263                    ${TESSELLATION_CONTROL_OUTPUT}
264                }
265            ""
266            tessellation_evaluation ""
267                #version 450
268                ${TESSELLATION_EVALUATION_DECLARATIONS}
269                in lowp float tc_out[];
270                out mediump float te_out;
271                void main()
272                {
273                    te_out = tc_out[2];
274                    ${TESSELLATION_EVALUATION_OUTPUT}
275                }
276            ""
277            fragment ""
278                #version 450
279                precision mediump float;
280                ${FRAGMENT_DECLARATIONS}
281                in mediump float te_out;
282                void main()
283                {
284                    out0 = te_out;
285                    ${FRAGMENT_OUTPUT}
286                }
287            ""
288        end
289
290        case input_superfluous_declaration
291            version 450
292            desc "Tessellation control has no input for an output"
293            values
294            {
295                input float in0 = 1.0;
296                output float out0 = 1.0;
297            }
298            vertex ""
299                #version 450
300                ${VERTEX_DECLARATIONS}
301                out mediump float tc_in;
302                out mediump float tc_in_unused;
303                void main()
304                {
305                    tc_in = in0;
306                    tc_in_unused = in0 + 1.0;
307                    ${VERTEX_OUTPUT}
308                }
309            ""
310            tessellation_control ""
311                #version 450
312                ${TESSELLATION_CONTROL_DECLARATIONS}
313                in mediump float tc_in[];
314                out mediump float tc_out[];
315                void main()
316                {
317                    tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
318                    ${TESSELLATION_CONTROL_OUTPUT}
319                }
320            ""
321            tessellation_evaluation ""
322                #version 450
323                ${TESSELLATION_EVALUATION_DECLARATIONS}
324                in mediump float tc_out[];
325                out mediump float te_out;
326                void main()
327                {
328                    te_out = tc_out[2];
329                    ${TESSELLATION_EVALUATION_OUTPUT}
330                }
331            ""
332            fragment ""
333                #version 450
334                precision mediump float;
335                ${FRAGMENT_DECLARATIONS}
336                in mediump float te_out;
337                void main()
338                {
339                    out0 = te_out;
340                    ${FRAGMENT_OUTPUT}
341                }
342            ""
343        end
344
345        case output_superfluous_declaration
346            version 450
347            desc "Tessellation has an output without a matching input"
348            values
349            {
350                input float in0 = 1.0;
351                output float out0 = 1.0;
352            }
353            vertex ""
354                #version 450
355                ${VERTEX_DECLARATIONS}
356                out mediump float tc_in;
357                void main()
358                {
359                    tc_in = in0;
360                    ${VERTEX_OUTPUT}
361                }
362            ""
363            tessellation_control ""
364                #version 450
365                ${TESSELLATION_CONTROL_DECLARATIONS}
366                in mediump float tc_in[];
367                out mediump float tc_out[];
368                void main()
369                {
370                    tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
371                    ${TESSELLATION_CONTROL_OUTPUT}
372                }
373            ""
374            tessellation_evaluation ""
375                #version 450
376                ${TESSELLATION_EVALUATION_DECLARATIONS}
377                in mediump float tc_out[];
378                out mediump float te_out;
379                out mediump float te_out_unused;
380                void main()
381                {
382                    te_out = tc_out[2];
383                    te_out_unused = tc_out[0];
384                    ${TESSELLATION_EVALUATION_OUTPUT}
385                }
386            ""
387            fragment ""
388                #version 450
389                precision mediump float;
390                ${FRAGMENT_DECLARATIONS}
391                in mediump float te_out;
392                void main()
393                {
394                    out0 = te_out;
395                    ${FRAGMENT_OUTPUT}
396                }
397            ""
398        end
399
400        case internal_superfluous_declaration
401            version 450
402            desc "Tessellation control has an output without a matching input"
403            values
404            {
405                input float in0 = 1.0;
406                output float out0 = 1.0;
407            }
408            vertex ""
409                #version 450
410                ${VERTEX_DECLARATIONS}
411                out mediump float tc_in;
412                void main()
413                {
414                    tc_in = in0;
415                    ${VERTEX_OUTPUT}
416                }
417            ""
418            tessellation_control ""
419                #version 450
420                ${TESSELLATION_CONTROL_DECLARATIONS}
421                in mediump float tc_in[];
422                out mediump float tc_out[];
423                out mediump float tc_out_unused[];
424                void main()
425                {
426                    tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
427                    tc_out_unused[gl_InvocationID] = tc_in[gl_InvocationID] + 1.0;
428                    ${TESSELLATION_CONTROL_OUTPUT}
429                }
430            ""
431            tessellation_evaluation ""
432                #version 450
433                ${TESSELLATION_EVALUATION_DECLARATIONS}
434                in mediump float tc_out[];
435                out mediump float te_out;
436                void main()
437                {
438                    te_out = tc_out[2];
439                    ${TESSELLATION_EVALUATION_OUTPUT}
440                }
441            ""
442            fragment ""
443                #version 450
444                precision mediump float;
445                ${FRAGMENT_DECLARATIONS}
446                in mediump float te_out;
447                void main()
448                {
449                    out0 = te_out;
450                    ${FRAGMENT_OUTPUT}
451                }
452            ""
453        end
454
455        case vertex_fragment_same_varying_name_1
456            version 450
457            desc "Tessellation control has an output without a matching input"
458            values
459            {
460                input float in0 = 1.0;
461                output float out0 = 2.0;
462            }
463            vertex ""
464                #version 450
465                ${VERTEX_DECLARATIONS}
466                out mediump float sharedVaringName;
467                void main()
468                {
469                    sharedVaringName = in0;
470                    ${VERTEX_OUTPUT}
471                }
472            ""
473            tessellation_control ""
474                #version 450
475                ${TESSELLATION_CONTROL_DECLARATIONS}
476                in mediump float sharedVaringName[];
477                out mediump float tc_out[];
478                void main()
479                {
480                    tc_out[gl_InvocationID] = sharedVaringName[gl_InvocationID];
481                    ${TESSELLATION_CONTROL_OUTPUT}
482                }
483            ""
484            tessellation_evaluation ""
485                #version 450
486                ${TESSELLATION_EVALUATION_DECLARATIONS}
487                in mediump float tc_out[];
488                out mediump float sharedVaringName;
489                void main()
490                {
491                    sharedVaringName = 2.0 * tc_out[2];
492                    ${TESSELLATION_EVALUATION_OUTPUT}
493                }
494            ""
495            fragment ""
496                #version 450
497                precision mediump float;
498                ${FRAGMENT_DECLARATIONS}
499                in mediump float sharedVaringName;
500                void main()
501                {
502                    out0 = sharedVaringName;
503                    ${FRAGMENT_OUTPUT}
504                }
505            ""
506        end
507
508        case vertex_fragment_same_varying_name_2
509            version 450
510            desc "Tessellation control has an output without a matching input"
511            values
512            {
513                input vec2 in0 = vec2(1.0, 3.0);
514                output float out0 = 4.0;
515            }
516            vertex ""
517                #version 450
518                ${VERTEX_DECLARATIONS}
519                out mediump vec2 sharedVaringName;
520                void main()
521                {
522                    sharedVaringName = in0;
523                    ${VERTEX_OUTPUT}
524                }
525            ""
526            tessellation_control ""
527                #version 450
528                ${TESSELLATION_CONTROL_DECLARATIONS}
529                in mediump vec2 sharedVaringName[];
530                out mediump float tc_out[];
531                void main()
532                {
533                    tc_out[gl_InvocationID] = sharedVaringName[gl_InvocationID].x + sharedVaringName[gl_InvocationID].y;
534                    ${TESSELLATION_CONTROL_OUTPUT}
535                }
536            ""
537            tessellation_evaluation ""
538                #version 450
539                ${TESSELLATION_EVALUATION_DECLARATIONS}
540                in mediump float tc_out[];
541                out mediump float sharedVaringName;
542                void main()
543                {
544                    sharedVaringName = tc_out[2];
545                    ${TESSELLATION_EVALUATION_OUTPUT}
546                }
547            ""
548            fragment ""
549                #version 450
550                precision mediump float;
551                ${FRAGMENT_DECLARATIONS}
552                in mediump float sharedVaringName;
553                void main()
554                {
555                    out0 = sharedVaringName;
556                    ${FRAGMENT_OUTPUT}
557                }
558            ""
559        end
560
561        case invalid_vertex_index
562            version 450
563            desc "Tessellation control output not indexed with gl_InvocationID"
564            expect compile_or_link_fail
565            vertex ""
566                #version 450
567                ${VERTEX_DECLARATIONS}
568                void main()
569                {
570                    ${VERTEX_OUTPUT}
571                }
572            ""
573            tessellation_control ""
574                #version 450
575                ${TESSELLATION_CONTROL_DECLARATIONS}
576                out mediump float tc_out[];
577                void main()
578                {
579                    tc_out[2 - gl_InvocationID] = float(gl_InvocationID);
580                    ${TESSELLATION_CONTROL_OUTPUT}
581                }
582            ""
583            tessellation_evaluation ""
584                #version 450
585                ${TESSELLATION_EVALUATION_DECLARATIONS}
586                in mediump float tc_out[];
587                out mediump float te_out;
588                void main()
589                {
590                    te_out = tc_out[2];
591                    ${TESSELLATION_EVALUATION_OUTPUT}
592                }
593            ""
594            fragment ""
595                #version 450
596                precision mediump float;
597                ${FRAGMENT_DECLARATIONS}
598                in mediump float te_out;
599                void main()
600                {
601                    ${FRAG_COLOR} = vec4(te_out);
602                }
603            ""
604        end
605
606        case input_non_array
607            version 450
608            desc "Tessellation control input in not an array"
609            expect compile_or_link_fail
610            values
611            {
612                input float in0 = 1.0;
613                output float out0 = 1.0;
614            }
615            vertex ""
616                #version 450
617                ${VERTEX_DECLARATIONS}
618                out mediump float tc_in;
619                void main()
620                {
621                    tc_in = in0;
622                    ${VERTEX_OUTPUT}
623                }
624            ""
625            tessellation_control ""
626                #version 450
627                ${TESSELLATION_CONTROL_DECLARATIONS}
628                in mediump float tc_in;
629                out mediump float tc_out[];
630                void main()
631                {
632                    tc_out[gl_InvocationID] = tc_in;
633                    ${TESSELLATION_CONTROL_OUTPUT}
634                }
635            ""
636            tessellation_evaluation ""
637                #version 450
638                ${TESSELLATION_EVALUATION_DECLARATIONS}
639                in mediump float tc_out[];
640                out mediump float te_out;
641                void main()
642                {
643                    te_out = tc_out[2];
644                    ${TESSELLATION_EVALUATION_OUTPUT}
645                }
646            ""
647            fragment ""
648                #version 450
649                precision mediump float;
650                ${FRAGMENT_DECLARATIONS}
651                in mediump float te_out;
652                void main()
653                {
654                    out0 = te_out;
655                    ${FRAGMENT_OUTPUT}
656                }
657            ""
658        end
659
660        case input_array_size_mismatch
661            version 450
662            desc "Tessellation control input array size is not gl_MaxPatchVertices"
663            expect compile_or_link_fail
664            values
665            {
666                input float in0 = 1.0;
667                output float out0 = 1.0;
668            }
669            vertex ""
670                #version 450
671                ${VERTEX_DECLARATIONS}
672                out mediump float tc_in;
673                void main()
674                {
675                    tc_in = in0;
676                    ${VERTEX_OUTPUT}
677                }
678            ""
679            tessellation_control ""
680                #version 450
681                ${TESSELLATION_CONTROL_DECLARATIONS}
682                in mediump float tc_in[2]; // not gl_MaxPatchVertices
683                out mediump float tc_out[];
684                void main()
685                {
686                    tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
687                    ${TESSELLATION_CONTROL_OUTPUT}
688                }
689            ""
690            tessellation_evaluation ""
691                #version 450
692                ${TESSELLATION_EVALUATION_DECLARATIONS}
693                in mediump float tc_out[];
694                out mediump float te_out;
695                void main()
696                {
697                    te_out = tc_out[2];
698                    ${TESSELLATION_EVALUATION_OUTPUT}
699                }
700            ""
701            fragment ""
702                #version 450
703                precision mediump float;
704                ${FRAGMENT_DECLARATIONS}
705                in mediump float te_out;
706                void main()
707                {
708                    out0 = te_out;
709                    ${FRAGMENT_OUTPUT}
710                }
711            ""
712        end
713
714        case internal_array_size_mismatch
715            version 450
716            desc "Tessellation control output array size is not consistent with layout qualifier"
717            expect compile_or_link_fail
718            values
719            {
720                input float in0 = 1.0;
721                output float out0 = 1.0;
722            }
723            vertex ""
724                #version 450
725                ${VERTEX_DECLARATIONS}
726                out mediump float tc_in;
727                void main()
728                {
729                    tc_in = in0;
730                    ${VERTEX_OUTPUT}
731                }
732            ""
733            tessellation_control ""
734                #version 450
735                ${TESSELLATION_CONTROL_DECLARATIONS}
736                in mediump float tc_in[];
737                out mediump float tc_out[2]; // does not match output layout qualifier
738                void main()
739                {
740                    tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
741                    ${TESSELLATION_CONTROL_OUTPUT}
742                }
743            ""
744            tessellation_evaluation ""
745                #version 450
746                ${TESSELLATION_EVALUATION_DECLARATIONS}
747                in mediump float tc_out[2];
748                out mediump float te_out;
749                void main()
750                {
751                    te_out = tc_out[1];
752                    ${TESSELLATION_EVALUATION_OUTPUT}
753                }
754            ""
755            fragment ""
756                #version 450
757                precision mediump float;
758                ${FRAGMENT_DECLARATIONS}
759                in mediump float te_out;
760                void main()
761                {
762                    out0 = te_out;
763                    ${FRAGMENT_OUTPUT}
764                }
765            ""
766        end
767
768        case per_patch_qualifier_mismatch_1
769            version 450
770            desc "Tessellation control output is per-patch qualified, evaluation input is not"
771            expect compile_or_link_fail
772            values
773            {
774                input float in0 = 1.0;
775                output float out0 = 1.0;
776            }
777            vertex ""
778                #version 450
779                ${VERTEX_DECLARATIONS}
780                out mediump float tc_in;
781                void main()
782                {
783                    tc_in = in0;
784                    ${VERTEX_OUTPUT}
785                }
786            ""
787            tessellation_control ""
788                #version 450
789                ${TESSELLATION_CONTROL_DECLARATIONS}
790                in mediump float tc_in[];
791                patch out mediump float tc_out[gl_MaxPatchVertices];
792                void main()
793                {
794                    tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
795                    ${TESSELLATION_CONTROL_OUTPUT}
796                }
797            ""
798            tessellation_evaluation ""
799                #version 450
800                ${TESSELLATION_EVALUATION_DECLARATIONS}
801                in mediump float tc_out[gl_MaxPatchVertices];
802                out mediump float te_out;
803                void main()
804                {
805                    te_out = tc_out[2];
806                    ${TESSELLATION_EVALUATION_OUTPUT}
807                }
808            ""
809            fragment ""
810                #version 450
811                precision mediump float;
812                ${FRAGMENT_DECLARATIONS}
813                in mediump float te_out;
814                void main()
815                {
816                    out0 = te_out;
817                    ${FRAGMENT_OUTPUT}
818                }
819            ""
820        end
821
822        case per_patch_qualifier_mismatch_2
823            version 450
824            desc "Tessellation control output is not per-patch qualified, evaluation input is"
825            expect compile_or_link_fail
826            values
827            {
828                input float in0 = 1.0;
829                output float out0 = 1.0;
830            }
831            vertex ""
832                #version 450
833                ${VERTEX_DECLARATIONS}
834                out mediump float tc_in;
835                void main()
836                {
837                    tc_in = in0;
838                    ${VERTEX_OUTPUT}
839                }
840            ""
841            tessellation_control ""
842                #version 450
843                ${TESSELLATION_CONTROL_DECLARATIONS}
844                in mediump float tc_in[];
845                out mediump float tc_out[gl_MaxPatchVertices];
846                void main()
847                {
848                    tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
849                    ${TESSELLATION_CONTROL_OUTPUT}
850                }
851            ""
852            tessellation_evaluation ""
853                #version 450
854                ${TESSELLATION_EVALUATION_DECLARATIONS}
855                patch in mediump float tc_out[gl_MaxPatchVertices];
856                out mediump float te_out;
857                void main()
858                {
859                    te_out = tc_out[2];
860                    ${TESSELLATION_EVALUATION_OUTPUT}
861                }
862            ""
863            fragment ""
864                #version 450
865                precision mediump float;
866                ${FRAGMENT_DECLARATIONS}
867                in mediump float te_out;
868                void main()
869                {
870                    out0 = te_out;
871                    ${FRAGMENT_OUTPUT}
872                }
873            ""
874        end
875
876        case input_block
877            version 450
878            desc "Tessellation control shader input block"
879            values { output float out0 = 1.0; }
880            vertex ""
881                #version 450
882                ${VERTEX_DECLARATIONS}
883                out IOBlockName
884                {
885                    mediump float var;
886                } outputInstanceName;
887                void main()
888                {
889                    outputInstanceName.var = 1.0;
890                    ${VERTEX_OUTPUT}
891                }
892            ""
893            tessellation_control ""
894                #version 450
895                ${TESSELLATION_CONTROL_DECLARATIONS}
896                in IOBlockName
897                {
898                    mediump float var;
899                } inputInstanceName[];
900                out mediump float tc_out[];
901                void main()
902                {
903                    tc_out[gl_InvocationID] = inputInstanceName[gl_InvocationID].var;
904                    ${TESSELLATION_CONTROL_OUTPUT}
905                }
906            ""
907            tessellation_evaluation ""
908                #version 450
909                ${TESSELLATION_EVALUATION_DECLARATIONS}
910                in mediump float tc_out[];
911                out mediump float te_out;
912                void main()
913                {
914                    te_out = tc_out[2];
915                    ${TESSELLATION_EVALUATION_OUTPUT}
916                }
917            ""
918            fragment ""
919                #version 450
920                precision mediump float;
921                ${FRAGMENT_DECLARATIONS}
922                in mediump float te_out;
923                void main()
924                {
925                    out0 = te_out;
926                    ${FRAGMENT_OUTPUT}
927                }
928            ""
929        end
930
931        case input_block_non_array
932            version 450
933            desc "Tessellation control shader input block with explicit array"
934            expect compile_or_link_fail
935            values { output float out0 = 1.0; }
936            vertex ""
937                #version 450
938                ${VERTEX_DECLARATIONS}
939                out IOBlockName
940                {
941                    mediump float var;
942                } outputInstanceName;
943                void main()
944                {
945                    outputInstanceName.var = 1.0;
946                    ${VERTEX_OUTPUT}
947                }
948            ""
949            tessellation_control ""
950                #version 450
951                ${TESSELLATION_CONTROL_DECLARATIONS}
952                in IOBlockName
953                {
954                    mediump float var;
955                } inputInstanceName;
956                out mediump float tc_out[];
957                void main()
958                {
959                    tc_out[gl_InvocationID] = inputInstanceName.var;
960                    ${TESSELLATION_CONTROL_OUTPUT}
961                }
962            ""
963            tessellation_evaluation ""
964                #version 450
965                ${TESSELLATION_EVALUATION_DECLARATIONS}
966                in mediump float tc_out[];
967                out mediump float te_out;
968                void main()
969                {
970                    te_out = tc_out[2];
971                    ${TESSELLATION_EVALUATION_OUTPUT}
972                }
973            ""
974            fragment ""
975                #version 450
976                precision mediump float;
977                ${FRAGMENT_DECLARATIONS}
978                in mediump float geo_out;
979                void main()
980                {
981                    out0 = geo_out;
982                    ${FRAGMENT_OUTPUT}
983                }
984            ""
985        end
986
987        case input_block_array_size_mismatch
988            version 450
989            desc "Tessellation control shader input block array, size not gl_MaxPatchVertices"
990            expect compile_or_link_fail
991            values { output float out0 = 1.0; }
992            vertex ""
993                #version 450
994                ${VERTEX_DECLARATIONS}
995                out IOBlockName
996                {
997                    mediump float var;
998                } outputInstanceName;
999                void main()
1000                {
1001                    outputInstanceName.var = 1.0;
1002                    ${VERTEX_OUTPUT}
1003                }
1004            ""
1005            tessellation_control ""
1006                #version 450
1007                ${TESSELLATION_CONTROL_DECLARATIONS}
1008                in IOBlockName
1009                {
1010                    mediump float var;
1011                } inputInstanceName[4]; // not gl_MaxPatchVertices
1012                out mediump float tc_out[];
1013                void main()
1014                {
1015                    tc_out[gl_InvocationID] = inputInstanceName[gl_InvocationID + 1].var;
1016                    ${TESSELLATION_CONTROL_OUTPUT}
1017                }
1018            ""
1019            tessellation_evaluation ""
1020                #version 450
1021                ${TESSELLATION_EVALUATION_DECLARATIONS}
1022                in mediump float tc_out[];
1023                out mediump float te_out;
1024                void main()
1025                {
1026                    te_out = tc_out[2];
1027                    ${TESSELLATION_EVALUATION_OUTPUT}
1028                }
1029            ""
1030            fragment ""
1031                #version 450
1032                precision mediump float;
1033                ${FRAGMENT_DECLARATIONS}
1034                in mediump float geo_out;
1035                void main()
1036                {
1037                    out0 = geo_out;
1038                    ${FRAGMENT_OUTPUT}
1039                }
1040            ""
1041        end
1042
1043        case output_block
1044            version 450
1045            desc "Tessellation shader output block"
1046            values { output float out0 = 1.0; }
1047            vertex ""
1048                #version 450
1049                ${VERTEX_DECLARATIONS}
1050                void main()
1051                {
1052                    ${VERTEX_OUTPUT}
1053                }
1054            ""
1055            tessellation_control ""
1056                #version 450
1057                ${TESSELLATION_CONTROL_DECLARATIONS}
1058                void main()
1059                {
1060                    ${TESSELLATION_CONTROL_OUTPUT}
1061                }
1062            ""
1063            tessellation_evaluation ""
1064                #version 450
1065                ${TESSELLATION_EVALUATION_DECLARATIONS}
1066                out IOBlockName
1067                {
1068                    mediump float var;
1069                } outputInstanceName;
1070                void main()
1071                {
1072                    outputInstanceName.var = 1.0;
1073                    ${TESSELLATION_EVALUATION_OUTPUT}
1074                }
1075            ""
1076            fragment ""
1077                #version 450
1078                precision mediump float;
1079                ${FRAGMENT_DECLARATIONS}
1080                in IOBlockName
1081                {
1082                    mediump float var;
1083                } inputInstanceName;
1084                void main()
1085                {
1086                    out0 = inputInstanceName.var;
1087                    ${FRAGMENT_OUTPUT}
1088                }
1089            ""
1090        end
1091
1092        case output_block_array
1093            version 450
1094            desc "Tessellation shader output block array"
1095            values { output float out0 = 1.0; }
1096            vertex ""
1097                #version 450
1098                ${VERTEX_DECLARATIONS}
1099                void main()
1100                {
1101                    ${VERTEX_OUTPUT}
1102                }
1103            ""
1104            tessellation_control ""
1105                #version 450
1106                ${TESSELLATION_CONTROL_DECLARATIONS}
1107                void main()
1108                {
1109                    ${TESSELLATION_CONTROL_OUTPUT}
1110                }
1111            ""
1112            tessellation_evaluation ""
1113                #version 450
1114                ${TESSELLATION_EVALUATION_DECLARATIONS}
1115                out IOBlockName
1116                {
1117                    mediump float var;
1118                } outputInstanceName[2];
1119                void main()
1120                {
1121                    outputInstanceName[0].var = 2.0;
1122                    outputInstanceName[1].var = 1.0;
1123                    ${TESSELLATION_EVALUATION_OUTPUT}
1124                }
1125            ""
1126            fragment ""
1127                #version 450
1128                precision mediump float;
1129                ${FRAGMENT_DECLARATIONS}
1130                in IOBlockName
1131                {
1132                    mediump float var;
1133                } inputInstanceName[2];
1134                void main()
1135                {
1136                    out0 = inputInstanceName[0].var - inputInstanceName[1].var;
1137                    ${FRAGMENT_OUTPUT}
1138                }
1139            ""
1140        end
1141
1142        case unspecified_vertex_count
1143            version 450
1144            desc "Tessellation shader unspecified vertex count"
1145            expect compile_or_link_fail
1146            vertex ""
1147                #version 450
1148                ${VERTEX_DECLARATIONS}
1149                void main()
1150                {
1151                    ${VERTEX_OUTPUT}
1152                }
1153            ""
1154            tessellation_control ""
1155                #version 450
1156                void main()
1157                {
1158                    ${TESSELLATION_CONTROL_OUTPUT}
1159                }
1160            ""
1161            tessellation_evaluation ""
1162                #version 450
1163                ${TESSELLATION_EVALUATION_DECLARATIONS}
1164                void main()
1165                {
1166                    ${TESSELLATION_EVALUATION_OUTPUT}
1167                }
1168            ""
1169            fragment ""
1170                #version 450
1171                precision mediump float;
1172                ${FRAGMENT_DECLARATIONS}
1173                void main()
1174                {
1175                    ${FRAGMENT_OUTPUT}
1176                }
1177            ""
1178        end
1179
1180        case unspecified_primitive_mode
1181            version 450
1182            desc "Tessellation shader unspecified vertex count"
1183            expect compile_or_link_fail
1184            vertex ""
1185                #version 450
1186                ${VERTEX_DECLARATIONS}
1187                void main()
1188                {
1189                    ${VERTEX_OUTPUT}
1190                }
1191            ""
1192            tessellation_control ""
1193                #version 450
1194                ${TESSELLATION_CONTROL_DECLARATIONS}
1195                void main()
1196                {
1197                    ${TESSELLATION_CONTROL_OUTPUT}
1198                }
1199            ""
1200            tessellation_evaluation ""
1201                #version 450
1202                void main()
1203                {
1204                    ${TESSELLATION_EVALUATION_OUTPUT}
1205                }
1206            ""
1207            fragment ""
1208                #version 450
1209                precision mediump float;
1210                ${FRAGMENT_DECLARATIONS}
1211                void main()
1212                {
1213                    ${FRAGMENT_OUTPUT}
1214                }
1215            ""
1216        end
1217    end
1218
1219    group qualifiers "Varying qualifiers"
1220        case smooth
1221            version 450
1222            desc "Smooth varying"
1223            values
1224            {
1225                input float in0 = 1.0;
1226                output float out0 = 1.0;
1227            }
1228            vertex ""
1229                #version 450
1230                ${VERTEX_DECLARATIONS}
1231                smooth out mediump float tc_in;
1232                void main()
1233                {
1234                    tc_in = in0;
1235                    ${VERTEX_OUTPUT}
1236                }
1237            ""
1238            tessellation_control ""
1239                #version 450
1240                ${TESSELLATION_CONTROL_DECLARATIONS}
1241                smooth in mediump float tc_in[];
1242                smooth out mediump float tc_out[];
1243                void main()
1244                {
1245                    tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
1246                    ${TESSELLATION_CONTROL_OUTPUT}
1247                }
1248            ""
1249            tessellation_evaluation ""
1250                #version 450
1251                ${TESSELLATION_EVALUATION_DECLARATIONS}
1252                smooth in mediump float tc_out[];
1253                smooth out mediump float te_out;
1254                void main()
1255                {
1256                    te_out = tc_out[2];
1257                    ${TESSELLATION_EVALUATION_OUTPUT}
1258                }
1259            ""
1260            fragment ""
1261                #version 450
1262                precision mediump float;
1263                ${FRAGMENT_DECLARATIONS}
1264                smooth in mediump float te_out;
1265                void main()
1266                {
1267                    out0 = te_out;
1268                    ${FRAGMENT_OUTPUT}
1269                }
1270            ""
1271        end
1272
1273        case flat
1274            version 450
1275            desc "Flat varying"
1276            values
1277            {
1278                input float in0 = 1.0;
1279                output float out0 = 1.0;
1280            }
1281            vertex ""
1282                #version 450
1283                ${VERTEX_DECLARATIONS}
1284                flat out mediump float tc_in;
1285                void main()
1286                {
1287                    tc_in = in0;
1288                    ${VERTEX_OUTPUT}
1289                }
1290            ""
1291            tessellation_control ""
1292                #version 450
1293                ${TESSELLATION_CONTROL_DECLARATIONS}
1294                flat in mediump float tc_in[];
1295                flat out mediump float tc_out[];
1296                void main()
1297                {
1298                    tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
1299                    ${TESSELLATION_CONTROL_OUTPUT}
1300                }
1301            ""
1302            tessellation_evaluation ""
1303                #version 450
1304                ${TESSELLATION_EVALUATION_DECLARATIONS}
1305                flat in mediump float tc_out[];
1306                flat out mediump float te_out;
1307                void main()
1308                {
1309                    te_out = tc_out[2];
1310                    ${TESSELLATION_EVALUATION_OUTPUT}
1311                }
1312            ""
1313            fragment ""
1314                #version 450
1315                precision mediump float;
1316                ${FRAGMENT_DECLARATIONS}
1317                flat in mediump float te_out;
1318                void main()
1319                {
1320                    out0 = te_out;
1321                    ${FRAGMENT_OUTPUT}
1322                }
1323            ""
1324        end
1325
1326        case centroid
1327            version 450
1328            desc "Centroid varying"
1329            values
1330            {
1331                input float in0 = 1.0;
1332                output float out0 = 1.0;
1333            }
1334            vertex ""
1335                #version 450
1336                ${VERTEX_DECLARATIONS}
1337                centroid out mediump float tc_in;
1338                void main()
1339                {
1340                    tc_in = in0;
1341                    ${VERTEX_OUTPUT}
1342                }
1343            ""
1344            tessellation_control ""
1345                #version 450
1346                ${TESSELLATION_CONTROL_DECLARATIONS}
1347                centroid in mediump float tc_in[];
1348                centroid out mediump float tc_out[];
1349                void main()
1350                {
1351                    tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
1352                    ${TESSELLATION_CONTROL_OUTPUT}
1353                }
1354            ""
1355            tessellation_evaluation ""
1356                #version 450
1357                ${TESSELLATION_EVALUATION_DECLARATIONS}
1358                centroid in mediump float tc_out[];
1359                centroid out mediump float te_out;
1360                void main()
1361                {
1362                    te_out = tc_out[2];
1363                    ${TESSELLATION_EVALUATION_OUTPUT}
1364                }
1365            ""
1366            fragment ""
1367                #version 450
1368                precision mediump float;
1369                ${FRAGMENT_DECLARATIONS}
1370                centroid in mediump float te_out;
1371                void main()
1372                {
1373                    out0 = te_out;
1374                    ${FRAGMENT_OUTPUT}
1375                }
1376            ""
1377        end
1378
1379        case sample
1380            version 450
1381            desc "Sample varying"
1382            values
1383            {
1384                input float in0 = 1.0;
1385                output float out0 = 1.0;
1386            }
1387            vertex ""
1388                #version 450
1389                ${VERTEX_DECLARATIONS}
1390                sample out mediump float tc_in;
1391                void main()
1392                {
1393                    tc_in = in0;
1394                    ${VERTEX_OUTPUT}
1395                }
1396            ""
1397            tessellation_control ""
1398                #version 450
1399                ${TESSELLATION_CONTROL_DECLARATIONS}
1400                sample in mediump float tc_in[];
1401                sample out mediump float tc_out[];
1402                void main()
1403                {
1404                    tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
1405                    ${TESSELLATION_CONTROL_OUTPUT}
1406                }
1407            ""
1408            tessellation_evaluation ""
1409                #version 450
1410                ${TESSELLATION_EVALUATION_DECLARATIONS}
1411                sample in mediump float tc_out[];
1412                sample out mediump float te_out;
1413                void main()
1414                {
1415                    te_out = tc_out[2];
1416                    ${TESSELLATION_EVALUATION_OUTPUT}
1417                }
1418            ""
1419            fragment ""
1420                #version 450
1421                precision mediump float;
1422                ${FRAGMENT_DECLARATIONS}
1423                sample in mediump float te_out;
1424                void main()
1425                {
1426                    out0 = te_out;
1427                    ${FRAGMENT_OUTPUT}
1428                }
1429            ""
1430        end
1431
1432        case patch
1433            version 450
1434            desc "Pre-patch varying"
1435            values
1436            {
1437                input float in0 = 1.0;
1438                output float out0 = 1.0;
1439            }
1440            vertex ""
1441                #version 450
1442                ${VERTEX_DECLARATIONS}
1443                out mediump float tc_in;
1444                void main()
1445                {
1446                    tc_in = in0;
1447                    ${VERTEX_OUTPUT}
1448                }
1449            ""
1450            tessellation_control ""
1451                #version 450
1452                ${TESSELLATION_CONTROL_DECLARATIONS}
1453                in mediump float tc_in[];
1454                patch out mediump float tc_out;
1455                void main()
1456                {
1457                    tc_out = tc_in[gl_InvocationID];
1458                    ${TESSELLATION_CONTROL_OUTPUT}
1459                }
1460            ""
1461            tessellation_evaluation ""
1462                #version 450
1463                ${TESSELLATION_EVALUATION_DECLARATIONS}
1464                patch in mediump float tc_out;
1465                out mediump float te_out;
1466                void main()
1467                {
1468                    te_out = tc_out;
1469                    ${TESSELLATION_EVALUATION_OUTPUT}
1470                }
1471            ""
1472            fragment ""
1473                #version 450
1474                precision mediump float;
1475                ${FRAGMENT_DECLARATIONS}
1476                in mediump float te_out;
1477                void main()
1478                {
1479                    out0 = te_out;
1480                    ${FRAGMENT_OUTPUT}
1481                }
1482            ""
1483        end
1484    end
1485
1486    import "linkage_tessellation_varying_types.test"
1487end
1488
1489group uniform "Uniform"
1490    group rules "Rules"
1491        case type_mismatch_1
1492            version 450
1493            desc "uniform type mismatch between vertex and tessellation control shaders"
1494            expect link_fail
1495            vertex ""
1496                #version 450
1497                ${VERTEX_DECLARATIONS}
1498                uniform mediump float val;
1499                out mediump float vtx_out;
1500                void main()
1501                {
1502                    vtx_out = val;
1503                    ${VERTEX_OUTPUT}
1504                }
1505            ""
1506            tessellation_control ""
1507                #version 450
1508                ${TESSELLATION_CONTROL_DECLARATIONS}
1509                uniform mediump vec2 val;
1510                in mediump float vtx_out[];
1511                out mediump float tc_out[];
1512                void main()
1513                {
1514                    tc_out[gl_InvocationID] = vtx_out[0] + val.x + val.y;
1515                    ${TESSELLATION_CONTROL_OUTPUT}
1516                }
1517            ""
1518            tessellation_evaluation ""
1519                #version 450
1520                ${TESSELLATION_EVALUATION_DECLARATIONS}
1521                in mediump float tc_out[];
1522                out mediump float te_out;
1523                void main()
1524                {
1525                    te_out = tc_out[2];
1526                    ${TESSELLATION_EVALUATION_OUTPUT}
1527                }
1528            ""
1529            fragment ""
1530                #version 450
1531                precision mediump float;
1532                ${FRAGMENT_DECLARATIONS}
1533                in mediump float te_out;
1534                void main()
1535                {
1536                    ${FRAG_COLOR} = vec4(te_out);
1537                }
1538            ""
1539        end
1540
1541        case type_mismatch_2
1542            version 450
1543            desc "uniform type mismatch between fragment and tessellation eval shaders"
1544            expect link_fail
1545            vertex ""
1546                #version 450
1547                ${VERTEX_DECLARATIONS}
1548                out mediump float vtx_out;
1549                void main()
1550                {
1551                    ${VERTEX_OUTPUT}
1552                }
1553            ""
1554            tessellation_control ""
1555                #version 450
1556                ${TESSELLATION_CONTROL_DECLARATIONS}
1557                void main()
1558                {
1559                    ${TESSELLATION_CONTROL_OUTPUT}
1560                }
1561            ""
1562            tessellation_evaluation ""
1563                #version 450
1564                ${TESSELLATION_EVALUATION_DECLARATIONS}
1565                uniform mediump vec3 val;
1566                out mediump float te_out;
1567                void main()
1568                {
1569                    te_out = val.x + val.y + val.z;
1570                    ${TESSELLATION_EVALUATION_OUTPUT}
1571                }
1572            ""
1573            fragment ""
1574                #version 450
1575                precision mediump float;
1576                ${FRAGMENT_DECLARATIONS}
1577                uniform mediump vec4 val;
1578                in mediump float te_out;
1579                void main()
1580                {
1581                    ${FRAG_COLOR} = vec4(te_out) + val;
1582                }
1583            ""
1584        end
1585
1586        case type_mismatch_3
1587            version 450
1588            desc "uniform type mismatch between tessellation control and eval shaders"
1589            expect link_fail
1590            vertex ""
1591                #version 450
1592                ${VERTEX_DECLARATIONS}
1593                out mediump float vtx_out;
1594                void main()
1595                {
1596                    ${VERTEX_OUTPUT}
1597                }
1598            ""
1599            tessellation_control ""
1600                #version 450
1601                ${TESSELLATION_CONTROL_DECLARATIONS}
1602                uniform mediump vec4 val;
1603                out mediump vec4 tc_out[];
1604                void main()
1605                {
1606                    tc_out[gl_InvocationID] = val;
1607                    ${TESSELLATION_CONTROL_OUTPUT}
1608                }
1609            ""
1610            tessellation_evaluation ""
1611                #version 450
1612                ${TESSELLATION_EVALUATION_DECLARATIONS}
1613                uniform mediump vec3 val;
1614                in mediump vec4 tc_out[];
1615                out mediump float te_out;
1616                void main()
1617                {
1618                    te_out = tc_out[0].w * val.z;
1619                    ${TESSELLATION_EVALUATION_OUTPUT}
1620                }
1621            ""
1622            fragment ""
1623                #version 450
1624                precision mediump float;
1625                ${FRAGMENT_DECLARATIONS}
1626                in mediump float te_out;
1627                void main()
1628                {
1629                    ${FRAG_COLOR} = vec4(te_out);
1630                }
1631            ""
1632        end
1633
1634        case type_mismatch_4
1635            version 450
1636            desc "uniform type mismatch between vertex and tessellation control shaders"
1637            expect link_fail
1638            require limit "GL_MAX_VERTEX_ATOMIC_COUNTERS" > 0
1639            vertex ""
1640                #version 450
1641                ${VERTEX_DECLARATIONS}
1642                layout(binding=0) uniform atomic_uint u_var;
1643                out mediump float vtx_out;
1644                void main()
1645                {
1646                    uint result = atomicCounterIncrement(u_var);
1647                    vtx_out = float(result);
1648                    ${VERTEX_OUTPUT}
1649                }
1650            ""
1651            tessellation_control ""
1652                #version 450
1653                ${TESSELLATION_CONTROL_DECLARATIONS}
1654                uniform mediump float u_var;
1655                in mediump float vtx_out[];
1656                out mediump float tc_out[];
1657                void main()
1658                {
1659                    tc_out[gl_InvocationID] = vtx_out[0] + u_var;
1660                    ${TESSELLATION_CONTROL_OUTPUT}
1661                }
1662            ""
1663            tessellation_evaluation ""
1664                #version 450
1665                ${TESSELLATION_EVALUATION_DECLARATIONS}
1666                in mediump float tc_out[];
1667                out mediump float te_out;
1668                void main()
1669                {
1670                    te_out = tc_out[2];
1671                    ${TESSELLATION_EVALUATION_OUTPUT}
1672                }
1673            ""
1674            fragment ""
1675                #version 450
1676                precision mediump float;
1677                ${FRAGMENT_DECLARATIONS}
1678                in mediump float te_out;
1679                void main()
1680                {
1681                    ${FRAG_COLOR} = vec4(te_out);
1682                }
1683            ""
1684        end
1685
1686        case type_mismatch_5
1687            version 450
1688            desc "uniform type mismatch between vertex and tessellation control shaders"
1689            expect link_fail
1690            require limit "GL_MAX_VERTEX_IMAGE_UNIFORMS" > 0
1691            vertex ""
1692                #version 450
1693                ${VERTEX_DECLARATIONS}
1694                layout(binding=0) layout(rgba8i) uniform readonly highp iimage2D u_var;
1695                out mediump float vtx_out;
1696                void main()
1697                {
1698                    int result = imageSize(u_var).x;
1699                    vtx_out = float(result);
1700                    ${VERTEX_OUTPUT}
1701                }
1702            ""
1703            tessellation_control ""
1704                #version 450
1705                ${TESSELLATION_CONTROL_DECLARATIONS}
1706                uniform mediump float u_var;
1707                in mediump float vtx_out[];
1708                out mediump float tc_out[];
1709                void main()
1710                {
1711                    tc_out[gl_InvocationID] = vtx_out[0] + u_var;
1712                    ${TESSELLATION_CONTROL_OUTPUT}
1713                }
1714            ""
1715            tessellation_evaluation ""
1716                #version 450
1717                ${TESSELLATION_EVALUATION_DECLARATIONS}
1718                in mediump float tc_out[];
1719                out mediump float te_out;
1720                void main()
1721                {
1722                    te_out = tc_out[2];
1723                    ${TESSELLATION_EVALUATION_OUTPUT}
1724                }
1725            ""
1726            fragment ""
1727                #version 450
1728                precision mediump float;
1729                ${FRAGMENT_DECLARATIONS}
1730                in mediump float te_out;
1731                void main()
1732                {
1733                    ${FRAG_COLOR} = vec4(te_out);
1734                }
1735            ""
1736        end
1737
1738        case struct_partial_usage
1739            version 450
1740            desc "uniform is partially used in different shader stages"
1741            values
1742            {
1743                uniform float val.vtxVal = 1.5;
1744                uniform float val.tcVal = 2.5;
1745                uniform float val.teVal = 6.0;
1746                uniform float val.fragVal = 11.0;
1747                output float out0 = 68.5;
1748            }
1749            vertex ""
1750                #version 450
1751                ${VERTEX_DECLARATIONS}
1752                struct S
1753                {
1754                    mediump float vtxVal;
1755                    mediump float tcVal;
1756                    mediump float teVal;
1757                    mediump float fragVal;
1758                };
1759                uniform S val;
1760                out mediump float vtx_out;
1761                void main()
1762                {
1763                    vtx_out = val.vtxVal;
1764                    ${VERTEX_OUTPUT}
1765                }
1766            ""
1767            tessellation_control ""
1768                #version 450
1769                ${TESSELLATION_CONTROL_DECLARATIONS}
1770                struct S
1771                {
1772                    mediump float vtxVal;
1773                    mediump float tcVal;
1774                    mediump float teVal;
1775                    mediump float fragVal;
1776                };
1777                uniform S val;
1778                in mediump float vtx_out[];
1779                out mediump float tc_out[];
1780                void main()
1781                {
1782                    tc_out[gl_InvocationID] = vtx_out[0] + 2.0 * val.tcVal;
1783                    ${TESSELLATION_CONTROL_OUTPUT}
1784                }
1785            ""
1786            tessellation_evaluation ""
1787                #version 450
1788                ${TESSELLATION_EVALUATION_DECLARATIONS}
1789                struct S
1790                {
1791                    mediump float vtxVal;
1792                    mediump float tcVal;
1793                    mediump float teVal;
1794                    mediump float fragVal;
1795                };
1796                uniform S val;
1797                in mediump float tc_out[];
1798                out mediump float te_out;
1799                void main()
1800                {
1801                    te_out = tc_out[2] + 3.0 * val.teVal;
1802                    ${TESSELLATION_EVALUATION_OUTPUT}
1803                }
1804            ""
1805            fragment ""
1806                #version 450
1807                precision mediump float;
1808                ${FRAGMENT_DECLARATIONS}
1809                struct S
1810                {
1811                    mediump float vtxVal;
1812                    mediump float tcVal;
1813                    mediump float teVal;
1814                    mediump float fragVal;
1815                };
1816                uniform S val;
1817                in mediump float te_out;
1818                void main()
1819                {
1820                    out0 = te_out + 4.0 * val.fragVal;
1821                    ${FRAGMENT_OUTPUT};
1822                }
1823            ""
1824        end
1825    end
1826
1827    import "linkage_tessellation_uniform_types.test"
1828end
1829