xref: /aosp_15_r20/external/deqp/data/gles31/shaders/es32/separate_shader_validation.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 "Default block varying matching"
21
22    case missing_input
23        version 320 es
24        desc "Variable has no matching input"
25        expect validation_fail
26
27        pipeline_program
28            active_stages {vertex}
29            vertex ""
30                #version 320 es
31                ${VERTEX_DECLARATIONS}
32                out mediump float v_val;
33                out mediump float v_val_no_such_input;
34                void main()
35                {
36                    v_val = float(gl_VertexID);
37                    v_val_no_such_input = 1.0;
38                    ${VERTEX_OUTPUT}
39                }
40            ""
41        end
42        pipeline_program
43            active_stages {fragment}
44            fragment ""
45                #version 320 es
46                ${FRAGMENT_DECLARATIONS}
47                in mediump float v_val;
48                void main()
49                {
50                    ${FRAG_COLOR} = vec4(v_val);
51                }
52            ""
53        end
54    end
55
56    case missing_output
57        version 320 es
58        desc "Variable has no matching output"
59        expect validation_fail
60
61        pipeline_program
62            active_stages {vertex}
63            vertex ""
64                #version 320 es
65                ${VERTEX_DECLARATIONS}
66                out mediump float v_val;
67                void main()
68                {
69                    v_val = float(gl_VertexID);
70                    ${VERTEX_OUTPUT}
71                }
72            ""
73        end
74        pipeline_program
75            active_stages {fragment}
76            fragment ""
77                #version 320 es
78                ${FRAGMENT_DECLARATIONS}
79                in mediump float v_val;
80                in mediump float v_val_no_such_output;
81                void main()
82                {
83                    ${FRAG_COLOR} = vec4(v_val + v_val_no_such_output);
84                }
85            ""
86        end
87    end
88
89    case mismatch_type
90        version 320 es
91        desc "Variable type mismatch"
92        expect validation_fail
93
94        pipeline_program
95            active_stages {vertex}
96            vertex ""
97                #version 320 es
98                ${VERTEX_DECLARATIONS}
99                out mediump vec3 v_val;
100                void main()
101                {
102                    v_val = vec3(float(gl_VertexID));
103                    ${VERTEX_OUTPUT}
104                }
105            ""
106        end
107        pipeline_program
108            active_stages {fragment}
109            fragment ""
110                #version 320 es
111                ${FRAGMENT_DECLARATIONS}
112                in mediump vec4 v_val;
113                void main()
114                {
115                    ${FRAG_COLOR} = v_val;
116                }
117            ""
118        end
119    end
120
121    case mismatch_precision
122        version 320 es
123        desc "Variable precision mismatch"
124        expect validation_fail
125
126        pipeline_program
127            active_stages {vertex}
128            vertex ""
129                #version 320 es
130                ${VERTEX_DECLARATIONS}
131                out mediump float v_val;
132                void main()
133                {
134                    v_val = float(gl_VertexID);
135                    ${VERTEX_OUTPUT}
136                }
137            ""
138        end
139        pipeline_program
140            active_stages {fragment}
141            fragment ""
142                #version 320 es
143                ${FRAGMENT_DECLARATIONS}
144                in highp float v_val;
145                void main()
146                {
147                    ${FRAG_COLOR} = vec4(v_val);
148                }
149            ""
150        end
151    end
152
153    case mismatch_explicit_location_type
154        version 320 es
155        desc "Variable type mismatch, explicit varying locations"
156        expect validation_fail
157
158        pipeline_program
159            active_stages {vertex}
160            vertex ""
161                #version 320 es
162                ${VERTEX_DECLARATIONS}
163                layout(location = 3) out mediump vec4 v_val;
164                void main()
165                {
166                    v_val = vec4(float(gl_VertexID));
167                    ${VERTEX_OUTPUT}
168                }
169            ""
170        end
171        pipeline_program
172            active_stages {fragment}
173            fragment ""
174                #version 320 es
175                ${FRAGMENT_DECLARATIONS}
176                layout(location = 3) in mediump vec2 v_val;
177                void main()
178                {
179                    ${FRAG_COLOR} = v_val.xxyy;
180                }
181            ""
182        end
183    end
184
185    case mismatch_explicit_location_precision
186        version 320 es
187        desc "Variable precision mismatch, explicit varying locations"
188        expect validation_fail
189
190        pipeline_program
191            active_stages {vertex}
192            vertex ""
193                #version 320 es
194                ${VERTEX_DECLARATIONS}
195                layout(location = 3) out mediump float v_val;
196                void main()
197                {
198                    v_val = float(gl_VertexID);
199                    ${VERTEX_OUTPUT}
200                }
201            ""
202        end
203        pipeline_program
204            active_stages {fragment}
205            fragment ""
206                #version 320 es
207                ${FRAGMENT_DECLARATIONS}
208                layout(location = 3) in highp float v_val;
209                void main()
210                {
211                    ${FRAG_COLOR} = vec4(v_val);
212                }
213            ""
214        end
215    end
216
217    case mismatch_explicit_location
218        version 320 es
219        desc "Variable location mismatch"
220        expect validation_fail
221
222        pipeline_program
223            active_stages {vertex}
224            vertex ""
225                #version 320 es
226                ${VERTEX_DECLARATIONS}
227                layout(location = 3) out mediump float v_val;
228                void main()
229                {
230                    v_val = float(gl_VertexID);
231                    ${VERTEX_OUTPUT}
232                }
233            ""
234        end
235        pipeline_program
236            active_stages {fragment}
237            fragment ""
238                #version 320 es
239                ${FRAGMENT_DECLARATIONS}
240                layout(location = 4) in mediump float v_val;
241                void main()
242                {
243                    ${FRAG_COLOR} = vec4(v_val);
244                }
245            ""
246        end
247    end
248
249    case mismatch_implicit_explicit_location_1
250        version 320 es
251        desc "Variable location mismatch"
252        expect validation_fail
253
254        pipeline_program
255            active_stages {vertex}
256            vertex ""
257                #version 320 es
258                ${VERTEX_DECLARATIONS}
259                out mediump float v_val;
260                void main()
261                {
262                    v_val = float(gl_VertexID);
263                    ${VERTEX_OUTPUT}
264                }
265            ""
266        end
267        pipeline_program
268            active_stages {fragment}
269            fragment ""
270                #version 320 es
271                ${FRAGMENT_DECLARATIONS}
272                layout(location = 3) in mediump float v_val;
273                void main()
274                {
275                    ${FRAG_COLOR} = vec4(v_val);
276                }
277            ""
278        end
279    end
280
281    case mismatch_implicit_explicit_location_2
282        version 320 es
283        desc "Variable location mismatch"
284        expect validation_fail
285
286        pipeline_program
287            active_stages {vertex}
288            vertex ""
289                #version 320 es
290                ${VERTEX_DECLARATIONS}
291                layout(location = 3) out mediump float v_val;
292                void main()
293                {
294                    v_val = float(gl_VertexID);
295                    ${VERTEX_OUTPUT}
296                }
297            ""
298        end
299        pipeline_program
300            active_stages {fragment}
301            fragment ""
302                #version 320 es
303                ${FRAGMENT_DECLARATIONS}
304                in mediump float v_val;
305                layout(location = 3) in mediump float v_val_other_name;
306                void main()
307                {
308                    ${FRAG_COLOR} = vec4(v_val + v_val_other_name);
309                }
310            ""
311        end
312    end
313
314    case mismatch_implicit_explicit_location_3
315        version 320 es
316        desc "Variable location mismatch"
317        expect validation_fail
318
319        pipeline_program
320            active_stages {vertex}
321            vertex ""
322                #version 320 es
323                ${VERTEX_DECLARATIONS}
324                out mediump float v_val;
325                layout(location = 3) out mediump float v_val_other_name;
326                void main()
327                {
328                    v_val = float(gl_VertexID);
329                    v_val_other_name = 1.0;
330                    ${VERTEX_OUTPUT}
331                }
332            ""
333        end
334        pipeline_program
335            active_stages {fragment}
336            fragment ""
337                #version 320 es
338                ${FRAGMENT_DECLARATIONS}
339                layout(location = 3) in mediump float v_val;
340                void main()
341                {
342                    ${FRAG_COLOR} = vec4(v_val);
343                }
344            ""
345        end
346    end
347
348    case match_different_struct_names
349        version 320 es
350        desc "Variable struct names different but otherwise identical"
351        expect validation_fail
352
353        pipeline_program
354            active_stages {vertex}
355            vertex ""
356                #version 320 es
357                ${VERTEX_DECLARATIONS}
358                struct StructureNameA
359                {
360                    mediump float member;
361                };
362                out StructureNameA v_val;
363                void main()
364                {
365                    v_val.member = float(gl_VertexID);
366                    ${VERTEX_OUTPUT}
367                }
368            ""
369        end
370        pipeline_program
371            active_stages {fragment}
372            fragment ""
373                #version 320 es
374                ${FRAGMENT_DECLARATIONS}
375                struct StructureNameB
376                {
377                    mediump float member;
378                };
379                in StructureNameB v_val;
380                void main()
381                {
382                    // should always produce white
383                    ${FRAG_COLOR} = (v_val.member > -1.0) ? (vec4(1.0)) : (vec4(0.0));
384                }
385            ""
386        end
387    end
388
389    case mismatch_struct_member_name
390        version 320 es
391        desc "Struct member name mismatch"
392        expect validation_fail
393
394        pipeline_program
395            active_stages {vertex}
396            vertex ""
397                #version 320 es
398                ${VERTEX_DECLARATIONS}
399                struct StructureName
400                {
401                    mediump float member;
402                };
403                out StructureName v_val;
404                void main()
405                {
406                    v_val.member = float(gl_VertexID);
407                    ${VERTEX_OUTPUT}
408                }
409            ""
410        end
411        pipeline_program
412            active_stages {fragment}
413            fragment ""
414                #version 320 es
415                ${FRAGMENT_DECLARATIONS}
416                struct StructureName
417                {
418                    mediump float member_different_name;
419                };
420                in StructureName v_val;
421                void main()
422                {
423                    ${FRAG_COLOR} = vec4(v_val.member_different_name);
424                }
425            ""
426        end
427    end
428
429    case mismatch_struct_member_type
430        version 320 es
431        desc "Struct member type mismatch"
432        expect validation_fail
433
434        pipeline_program
435            active_stages {vertex}
436            vertex ""
437                #version 320 es
438                ${VERTEX_DECLARATIONS}
439                struct StructureName
440                {
441                    mediump float member;
442                };
443                out StructureName v_val;
444                void main()
445                {
446                    v_val.member = float(gl_VertexID);
447                    ${VERTEX_OUTPUT}
448                }
449            ""
450        end
451        pipeline_program
452            active_stages {fragment}
453            fragment ""
454                #version 320 es
455                ${FRAGMENT_DECLARATIONS}
456                struct StructureName
457                {
458                    mediump vec2 member;
459                };
460                in StructureName v_val;
461                void main()
462                {
463                    ${FRAG_COLOR} = vec4(v_val.member.x);
464                }
465            ""
466        end
467    end
468
469    case mismatch_struct_member_precision
470        version 320 es
471        desc "Struct member precision mismatch"
472        expect validation_fail
473
474        pipeline_program
475            active_stages {vertex}
476            vertex ""
477                #version 320 es
478                ${VERTEX_DECLARATIONS}
479                struct StructureName
480                {
481                    mediump float member;
482                };
483                out StructureName v_val;
484                void main()
485                {
486                    v_val.member = float(gl_VertexID);
487                    ${VERTEX_OUTPUT}
488                }
489            ""
490        end
491        pipeline_program
492            active_stages {fragment}
493            fragment ""
494                #version 320 es
495                ${FRAGMENT_DECLARATIONS}
496                struct StructureName
497                {
498                    highp float member;
499                };
500                in StructureName v_val;
501                void main()
502                {
503                    ${FRAG_COLOR} = vec4(v_val.member);
504                }
505            ""
506        end
507    end
508
509    case mismatch_struct_member_order
510        version 320 es
511        desc "Struct member order mismatch"
512        expect validation_fail
513
514        pipeline_program
515            active_stages {vertex}
516            vertex ""
517                #version 320 es
518                ${VERTEX_DECLARATIONS}
519                struct StructureName
520                {
521                    mediump float memberA;
522                    mediump float memberB;
523                };
524                out StructureName v_val;
525                void main()
526                {
527                    v_val.memberA = float(gl_VertexID);
528                    v_val.memberB = 1.0;
529                    ${VERTEX_OUTPUT}
530                }
531            ""
532        end
533        pipeline_program
534            active_stages {fragment}
535            fragment ""
536                #version 320 es
537                ${FRAGMENT_DECLARATIONS}
538                struct StructureName
539                {
540                    mediump float memberB;
541                    mediump float memberA;
542                };
543                in StructureName v_val;
544                void main()
545                {
546                    ${FRAG_COLOR} = vec4(v_val.memberA + v_val.memberB);
547                }
548            ""
549        end
550    end
551
552    case mismatch_array_element_type
553        version 320 es
554        desc "Array element type mismatch"
555        expect validation_fail
556
557        pipeline_program
558            active_stages {vertex}
559            vertex ""
560                #version 320 es
561                ${VERTEX_DECLARATIONS}
562                out mediump float v_val[2];
563                void main()
564                {
565                    v_val[0] = 1.0;
566                    v_val[1] = 2.0;
567                    ${VERTEX_OUTPUT}
568                }
569            ""
570        end
571        pipeline_program
572            active_stages {fragment}
573            fragment ""
574                #version 320 es
575                ${FRAGMENT_DECLARATIONS}
576                in mediump vec2 v_val[2];
577                void main()
578                {
579                    ${FRAG_COLOR} = vec4(v_val[0].x + v_val[1].y);
580                }
581            ""
582        end
583    end
584
585    case mismatch_array_length
586        version 320 es
587        desc "Array length mismatch"
588        expect validation_fail
589
590        pipeline_program
591            active_stages {vertex}
592            vertex ""
593                #version 320 es
594                ${VERTEX_DECLARATIONS}
595                out mediump float v_val[2];
596                void main()
597                {
598                    v_val[0] = 1.0;
599                    v_val[1] = 2.0;
600                    ${VERTEX_OUTPUT}
601                }
602            ""
603        end
604        pipeline_program
605            active_stages {fragment}
606            fragment ""
607                #version 320 es
608                ${FRAGMENT_DECLARATIONS}
609                in mediump float v_val[3];
610                void main()
611                {
612                    ${FRAG_COLOR} = vec4(v_val[0] + v_val[1] + v_val[2]);
613                }
614            ""
615        end
616    end
617
618    case mismatch_array_precision
619        version 320 es
620        desc "Array length mismatch"
621        expect validation_fail
622
623        pipeline_program
624            active_stages {vertex}
625            vertex ""
626                #version 320 es
627                ${VERTEX_DECLARATIONS}
628                out mediump float v_val[2];
629                void main()
630                {
631                    v_val[0] = 1.0;
632                    v_val[1] = 2.0;
633                    ${VERTEX_OUTPUT}
634                }
635            ""
636        end
637        pipeline_program
638            active_stages {fragment}
639            fragment ""
640                #version 320 es
641                ${FRAGMENT_DECLARATIONS}
642                in highp float v_val[2];
643                void main()
644                {
645                    ${FRAG_COLOR} = vec4(v_val[0] + v_val[1]);
646                }
647            ""
648        end
649    end
650
651    case mismatch_qualifier_vertex_flat_fragment_none
652        version 320 es
653        desc "Interpolation qualifier mismatch"
654        expect validation_fail
655
656        pipeline_program
657            active_stages {vertex}
658            vertex ""
659                #version 320 es
660                ${VERTEX_DECLARATIONS}
661                out flat highp vec4 v_val;
662                void main()
663                {
664                    v_val = vec4(float(gl_VertexID));
665                    ${VERTEX_OUTPUT}
666                }
667            ""
668        end
669        pipeline_program
670            active_stages {fragment}
671            fragment ""
672                #version 320 es
673                ${FRAGMENT_DECLARATIONS}
674                in highp vec4 v_val;
675                void main()
676                {
677                    ${FRAG_COLOR} = v_val;
678                }
679            ""
680        end
681    end
682
683    case mismatch_qualifier_vertex_flat_fragment_smooth
684        version 320 es
685        desc "Interpolation qualifier mismatch"
686        expect validation_fail
687
688        pipeline_program
689            active_stages {vertex}
690            vertex ""
691                #version 320 es
692                ${VERTEX_DECLARATIONS}
693                out flat highp vec4 v_val;
694                void main()
695                {
696                    v_val = vec4(float(gl_VertexID));
697                    ${VERTEX_OUTPUT}
698                }
699            ""
700        end
701        pipeline_program
702            active_stages {fragment}
703            fragment ""
704                #version 320 es
705                ${FRAGMENT_DECLARATIONS}
706                in smooth highp vec4 v_val;
707                void main()
708                {
709                    ${FRAG_COLOR} = v_val;
710                }
711            ""
712        end
713    end
714
715    case mismatch_qualifier_vertex_flat_fragment_centroid
716        version 320 es
717        desc "Interpolation qualifier mismatch"
718        expect validation_fail
719
720        pipeline_program
721            active_stages {vertex}
722            vertex ""
723                #version 320 es
724                ${VERTEX_DECLARATIONS}
725                out flat highp vec4 v_val;
726                void main()
727                {
728                    v_val = vec4(float(gl_VertexID));
729                    ${VERTEX_OUTPUT}
730                }
731            ""
732        end
733        pipeline_program
734            active_stages {fragment}
735            fragment ""
736                #version 320 es
737                ${FRAGMENT_DECLARATIONS}
738                in centroid highp vec4 v_val;
739                void main()
740                {
741                    ${FRAG_COLOR} = v_val;
742                }
743            ""
744        end
745    end
746
747    case mismatch_qualifier_vertex_smooth_fragment_flat
748        version 320 es
749        desc "Interpolation qualifier mismatch"
750        expect validation_fail
751
752        pipeline_program
753            active_stages {vertex}
754            vertex ""
755                #version 320 es
756                ${VERTEX_DECLARATIONS}
757                out smooth highp vec4 v_val;
758                void main()
759                {
760                    v_val = vec4(float(gl_VertexID));
761                    ${VERTEX_OUTPUT}
762                }
763            ""
764        end
765        pipeline_program
766            active_stages {fragment}
767            fragment ""
768                #version 320 es
769                ${FRAGMENT_DECLARATIONS}
770                in flat highp vec4 v_val;
771                void main()
772                {
773                    ${FRAG_COLOR} = v_val;
774                }
775            ""
776        end
777    end
778
779    case mismatch_qualifier_vertex_centroid_fragment_flat
780        version 320 es
781        desc "Interpolation qualifier mismatch"
782        expect validation_fail
783
784        pipeline_program
785            active_stages {vertex}
786            vertex ""
787                #version 320 es
788                ${VERTEX_DECLARATIONS}
789                out centroid highp vec4 v_val;
790                void main()
791                {
792                    v_val = vec4(float(gl_VertexID));
793                    ${VERTEX_OUTPUT}
794                }
795            ""
796        end
797        pipeline_program
798            active_stages {fragment}
799            fragment ""
800                #version 320 es
801                ${FRAGMENT_DECLARATIONS}
802                in flat highp vec4 v_val;
803                void main()
804                {
805                    ${FRAG_COLOR} = v_val;
806                }
807            ""
808        end
809    end
810end
811
812group io_blocks "shader io blocks"
813
814    case missing_input
815        version 320 es
816        desc "Missing input block"
817        expect validation_fail
818
819        pipeline_program
820            active_stages {vertex}
821            vertex ""
822                #version 320 es
823                ${VERTEX_DECLARATIONS}
824                out IOBlockName
825                {
826                    mediump float v_val;
827                };
828                void main()
829                {
830                    v_val = 1.0;
831                    ${VERTEX_OUTPUT}
832                }
833            ""
834        end
835        pipeline_program
836            active_stages {fragment}
837            fragment ""
838                #version 320 es
839                ${FRAGMENT_DECLARATIONS}
840                void main()
841                {
842                    ${FRAG_COLOR} = vec4(1.0);
843                }
844            ""
845        end
846    end
847
848    case missing_output
849        version 320 es
850        desc "Missing output block"
851        expect validation_fail
852
853        pipeline_program
854            active_stages {vertex}
855            vertex ""
856                #version 320 es
857                ${VERTEX_DECLARATIONS}
858                void main()
859                {
860                    ${VERTEX_OUTPUT}
861                }
862            ""
863        end
864        pipeline_program
865            active_stages {fragment}
866            fragment ""
867                #version 320 es
868                ${FRAGMENT_DECLARATIONS}
869                in IOBlockName
870                {
871                    mediump float v_val;
872                };
873                void main()
874                {
875                    ${FRAG_COLOR} = vec4(v_val);
876                }
877            ""
878        end
879    end
880
881    case mismatch_number_of_declarations
882        version 320 es
883        desc "IO-blocks do not match due to mismatch in number of declarations"
884        expect validation_fail
885
886        pipeline_program
887            active_stages {vertex}
888            vertex ""
889                #version 320 es
890                ${VERTEX_DECLARATIONS}
891                out IOBlockName
892                {
893                    mediump float v_valA;
894                    mediump float v_valB;
895                };
896                void main()
897                {
898                    v_valA = 1.0;
899                    v_valB = 2.0;
900                    ${VERTEX_OUTPUT}
901                }
902            ""
903        end
904        pipeline_program
905            active_stages {fragment}
906            fragment ""
907                #version 320 es
908                ${FRAGMENT_DECLARATIONS}
909                in IOBlockName
910                {
911                    mediump float v_valA;
912                };
913                void main()
914                {
915                    ${FRAG_COLOR} = vec4(v_valA);
916                }
917            ""
918        end
919    end
920
921    case mismatch_member_order
922        version 320 es
923        desc "IO-blocks do not match due to mismatch with member declaration order"
924        expect validation_fail
925
926        pipeline_program
927            active_stages {vertex}
928            vertex ""
929                #version 320 es
930                ${VERTEX_DECLARATIONS}
931                out IOBlockName
932                {
933                    mediump float v_valA;
934                    mediump float v_valB;
935                };
936                void main()
937                {
938                    v_valA = 1.0;
939                    v_valB = 2.0;
940                    ${VERTEX_OUTPUT}
941                }
942            ""
943        end
944        pipeline_program
945            active_stages {fragment}
946            fragment ""
947                #version 320 es
948                ${FRAGMENT_DECLARATIONS}
949                in IOBlockName
950                {
951                    mediump float v_valB;
952                    mediump float v_valA;
953                };
954                void main()
955                {
956                    ${FRAG_COLOR} = vec4(v_valA+v_valB);
957                }
958            ""
959        end
960    end
961
962    case mismatch_member_type
963        version 320 es
964        desc "IO-blocks do not match due to mismatch with member types"
965        expect validation_fail
966
967        pipeline_program
968            active_stages {vertex}
969            vertex ""
970                #version 320 es
971                ${VERTEX_DECLARATIONS}
972                out IOBlockName
973                {
974                    mediump float v_valA;
975                };
976                void main()
977                {
978                    v_valA = 1.0;
979                    ${VERTEX_OUTPUT}
980                }
981            ""
982        end
983        pipeline_program
984            active_stages {fragment}
985            fragment ""
986                #version 320 es
987                ${FRAGMENT_DECLARATIONS}
988                in IOBlockName
989                {
990                    mediump vec2 v_valA;
991                };
992                void main()
993                {
994                    ${FRAG_COLOR} = vec4(v_valA.xyxy);
995                }
996            ""
997        end
998    end
999
1000    case mismatch_member_name
1001        version 320 es
1002        desc "IO-blocks do not match due to mismatch with member names"
1003        expect validation_fail
1004
1005        pipeline_program
1006            active_stages {vertex}
1007            vertex ""
1008                #version 320 es
1009                ${VERTEX_DECLARATIONS}
1010                out IOBlockName
1011                {
1012                    mediump float v_valA;
1013                };
1014                void main()
1015                {
1016                    v_valA = 1.0;
1017                    ${VERTEX_OUTPUT}
1018                }
1019            ""
1020        end
1021        pipeline_program
1022            active_stages {fragment}
1023            fragment ""
1024                #version 320 es
1025                ${FRAGMENT_DECLARATIONS}
1026                in IOBlockName
1027                {
1028                    mediump vec2 v_valB;
1029                };
1030                void main()
1031                {
1032                    ${FRAG_COLOR} = vec4(v_valB.y);
1033                }
1034            ""
1035        end
1036    end
1037
1038    case mismatch_member_precision
1039        version 320 es
1040        desc "IO-blocks do not match due to mismatch with member precisions"
1041        expect validation_fail
1042
1043        pipeline_program
1044            active_stages {vertex}
1045            vertex ""
1046                #version 320 es
1047                ${VERTEX_DECLARATIONS}
1048                out IOBlockName
1049                {
1050                    mediump float v_valA;
1051                };
1052                void main()
1053                {
1054                    v_valA = 1.0;
1055                    ${VERTEX_OUTPUT}
1056                }
1057            ""
1058        end
1059        pipeline_program
1060            active_stages {fragment}
1061            fragment ""
1062                #version 320 es
1063                ${FRAGMENT_DECLARATIONS}
1064                in IOBlockName
1065                {
1066                    highp float v_valA;
1067                };
1068                void main()
1069                {
1070                    ${FRAG_COLOR} = vec4(v_valA);
1071                }
1072            ""
1073        end
1074    end
1075
1076    case mismatch_different_member_interpolation
1077        version 320 es
1078        desc "IO-block members do not match due to different interpolation qualifiers"
1079        expect validation_fail
1080
1081        pipeline_program
1082            active_stages {vertex}
1083            vertex ""
1084                #version 320 es
1085                ${VERTEX_DECLARATIONS}
1086                out IOBlockName
1087                {
1088                    smooth out mediump float v_val;
1089                };
1090                void main()
1091                {
1092                    v_val = 1.0;
1093                    ${VERTEX_OUTPUT}
1094                }
1095            ""
1096        end
1097        pipeline_program
1098            active_stages {fragment}
1099            fragment ""
1100                #version 320 es
1101                ${FRAGMENT_DECLARATIONS}
1102                in IOBlockName
1103                {
1104                    flat in mediump float v_val;
1105                };
1106                void main()
1107                {
1108                    ${FRAG_COLOR} = vec4(v_val);
1109                }
1110            ""
1111        end
1112    end
1113
1114    case mismatch_member_array_size
1115        version 320 es
1116        desc "IO-blocks do not match due to mismatch with member array size"
1117        expect validation_fail
1118
1119        pipeline_program
1120            active_stages {vertex}
1121            vertex ""
1122                #version 320 es
1123                ${VERTEX_DECLARATIONS}
1124                out IOBlockName
1125                {
1126                    mediump float v_val_arr[2];
1127                };
1128                void main()
1129                {
1130                    v_val_arr[0] = 1.0;
1131                    v_val_arr[1] = 2.0;
1132                    ${VERTEX_OUTPUT}
1133                }
1134            ""
1135        end
1136        pipeline_program
1137            active_stages {fragment}
1138            fragment ""
1139                #version 320 es
1140                ${FRAGMENT_DECLARATIONS}
1141                in IOBlockName
1142                {
1143                    mediump float v_val_arr[1];
1144                };
1145                void main()
1146                {
1147                    ${FRAG_COLOR} = vec4(v_val_arr[0]);
1148                }
1149            ""
1150        end
1151    end
1152
1153    case match_different_member_struct_names
1154        version 320 es
1155        desc "IO-blocks match with structs with different names"
1156        expect validation_fail
1157
1158        pipeline_program
1159            active_stages {vertex}
1160            vertex ""
1161                #version 320 es
1162                ${VERTEX_DECLARATIONS}
1163                struct StructNameA
1164                {
1165                    mediump float v;
1166                };
1167                out IOBlockName
1168                {
1169                    StructNameA v_val;
1170                };
1171
1172                void main()
1173                {
1174                    v_val.v = 1.0;
1175                    ${VERTEX_OUTPUT}
1176                }
1177            ""
1178        end
1179        pipeline_program
1180            active_stages {fragment}
1181            fragment ""
1182                #version 320 es
1183                ${FRAGMENT_DECLARATIONS}
1184                struct StructNameB
1185                {
1186                    mediump float v;
1187                };
1188                in IOBlockName
1189                {
1190                    StructNameB v_val;
1191                };
1192                void main()
1193                {
1194                    ${FRAG_COLOR} = vec4(v_val.v);
1195                }
1196            ""
1197        end
1198    end
1199
1200    case mismatch_member_struct_member_name
1201        version 320 es
1202        desc "IO-blocks do not match due to mismatch with member structs"
1203        expect validation_fail
1204
1205        pipeline_program
1206            active_stages {vertex}
1207            vertex ""
1208                #version 320 es
1209                ${VERTEX_DECLARATIONS}
1210                struct StructName
1211                {
1212                    mediump float v;
1213                };
1214                out IOBlockName
1215                {
1216                    StructName v_val;
1217                };
1218
1219                void main()
1220                {
1221                    v_val.v = 1.0;
1222                    ${VERTEX_OUTPUT}
1223                }
1224            ""
1225        end
1226        pipeline_program
1227            active_stages {fragment}
1228            fragment ""
1229                #version 320 es
1230                ${FRAGMENT_DECLARATIONS}
1231                struct StructName
1232                {
1233                    mediump float v_alt_name;
1234                };
1235                in IOBlockName
1236                {
1237                    StructName v_val;
1238                };
1239                void main()
1240                {
1241                    ${FRAG_COLOR} = vec4(v_val.v_alt_name);
1242                }
1243            ""
1244        end
1245    end
1246
1247    case mismatch_member_struct_member_type
1248        version 320 es
1249        desc "IO-blocks do not match due to mismatch with member structs"
1250        expect validation_fail
1251
1252        pipeline_program
1253            active_stages {vertex}
1254            vertex ""
1255                #version 320 es
1256                ${VERTEX_DECLARATIONS}
1257                struct StructName
1258                {
1259                    mediump float v;
1260                };
1261                out IOBlockName
1262                {
1263                    StructName v_val;
1264                };
1265
1266                void main()
1267                {
1268                    v_val.v = 1.0;
1269                    ${VERTEX_OUTPUT}
1270                }
1271            ""
1272        end
1273        pipeline_program
1274            active_stages {fragment}
1275            fragment ""
1276                #version 320 es
1277                ${FRAGMENT_DECLARATIONS}
1278                struct StructName
1279                {
1280                    mediump vec2 v;
1281                };
1282                in IOBlockName
1283                {
1284                    StructName v_val;
1285                };
1286                void main()
1287                {
1288                    ${FRAG_COLOR} = vec4(v_val.v.x);
1289                }
1290            ""
1291        end
1292    end
1293
1294    case mismatch_member_struct_member_precision
1295        version 320 es
1296        desc "IO-blocks do not match due to mismatch with member structs"
1297        expect validation_fail
1298
1299        pipeline_program
1300            active_stages {vertex}
1301            vertex ""
1302                #version 320 es
1303                ${VERTEX_DECLARATIONS}
1304                struct StructName
1305                {
1306                    mediump float v;
1307                };
1308                out IOBlockName
1309                {
1310                    StructName v_val;
1311                };
1312
1313                void main()
1314                {
1315                    v_val.v = 1.0;
1316                    ${VERTEX_OUTPUT}
1317                }
1318            ""
1319        end
1320        pipeline_program
1321            active_stages {fragment}
1322            fragment ""
1323                #version 320 es
1324                ${FRAGMENT_DECLARATIONS}
1325                struct StructName
1326                {
1327                    highp float v;
1328                };
1329                in IOBlockName
1330                {
1331                    StructName v_val;
1332                };
1333                void main()
1334                {
1335                    ${FRAG_COLOR} = vec4(v_val.v);
1336                }
1337            ""
1338        end
1339    end
1340
1341    case mismatch_member_struct_member_order
1342        version 320 es
1343        desc "IO-blocks do not match due to mismatch with member structs"
1344        expect validation_fail
1345
1346        pipeline_program
1347            active_stages {vertex}
1348            vertex ""
1349                #version 320 es
1350                ${VERTEX_DECLARATIONS}
1351                struct StructName
1352                {
1353                    mediump float v_a;
1354                    mediump float v_b;
1355                };
1356                out IOBlockName
1357                {
1358                    StructName v_val;
1359                };
1360
1361                void main()
1362                {
1363                    v_val.v_a = 1.0;
1364                    v_val.v_b = 1.0;
1365                    ${VERTEX_OUTPUT}
1366                }
1367            ""
1368        end
1369        pipeline_program
1370            active_stages {fragment}
1371            fragment ""
1372                #version 320 es
1373                ${FRAGMENT_DECLARATIONS}
1374                struct StructName
1375                {
1376                    mediump float v_b;
1377                    mediump float v_a;
1378                };
1379                in IOBlockName
1380                {
1381                    StructName v_val;
1382                };
1383                void main()
1384                {
1385                    ${FRAG_COLOR} = vec4(v_val.v_a);
1386                }
1387            ""
1388        end
1389    end
1390
1391    case mismatch_array_size
1392        version 320 es
1393        desc "IO-blocks do not match due to mismatch with array sizes"
1394        expect validation_fail
1395
1396        pipeline_program
1397            active_stages {vertex}
1398            vertex ""
1399                #version 320 es
1400                ${VERTEX_DECLARATIONS}
1401                out IOBlockName
1402                {
1403                    mediump float v_val;
1404                } ioBlock[2];
1405                void main()
1406                {
1407                    ioBlock[0].v_val = 1.0;
1408                    ioBlock[1].v_val = 2.0;
1409                    ${VERTEX_OUTPUT}
1410                }
1411            ""
1412        end
1413        pipeline_program
1414            active_stages {fragment}
1415            fragment ""
1416                #version 320 es
1417                ${FRAGMENT_DECLARATIONS}
1418                in IOBlockName
1419                {
1420                    mediump float v_val;
1421                } ioBlock[1];
1422                void main()
1423                {
1424                    ${FRAG_COLOR} = vec4(ioBlock[0].v_val);
1425                }
1426            ""
1427        end
1428    end
1429
1430    case mismatch_variable_and_block_member_1
1431        version 320 es
1432        desc "IO-block does not match with variable"
1433        expect validation_fail
1434
1435        pipeline_program
1436            active_stages {vertex}
1437            vertex ""
1438                #version 320 es
1439                ${VERTEX_DECLARATIONS}
1440                out IOBlockName
1441                {
1442                    mediump float v_val;
1443                };
1444
1445                void main()
1446                {
1447                    v_val = 1.0;
1448                    ${VERTEX_OUTPUT}
1449                }
1450            ""
1451        end
1452        pipeline_program
1453            active_stages {fragment}
1454            fragment ""
1455                #version 320 es
1456                ${FRAGMENT_DECLARATIONS}
1457                in mediump float v_val;
1458                void main()
1459                {
1460                    ${FRAG_COLOR} = vec4(v_val);
1461                }
1462            ""
1463        end
1464    end
1465
1466    case mismatch_variable_and_block_member_2
1467        version 320 es
1468        desc "IO-block does not match with variable"
1469        expect validation_fail
1470
1471        pipeline_program
1472            active_stages {vertex}
1473            vertex ""
1474                #version 320 es
1475                ${VERTEX_DECLARATIONS}
1476                out VariableAndBlockName
1477                {
1478                    mediump float v_val;
1479                };
1480
1481                void main()
1482                {
1483                    v_val = 1.0;
1484                    ${VERTEX_OUTPUT}
1485                }
1486            ""
1487        end
1488        pipeline_program
1489            active_stages {fragment}
1490            fragment ""
1491                #version 320 es
1492                ${FRAGMENT_DECLARATIONS}
1493                in mediump float VariableAndBlockName;
1494                void main()
1495                {
1496                    ${FRAG_COLOR} = vec4(VariableAndBlockName);
1497                }
1498            ""
1499        end
1500    end
1501end
1502