2 group varying "Varying linkage"
5 case input_type_mismatch
7 desc "Tessellation control shader input type mismatch"
9 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
12 input float in0 = 1.0;
13 output float out0 = 1.0;
17 ${VERTEX_DECLARATIONS}
18 out mediump float tc_in;
25 tessellation_control ""
27 ${TESSELLATION_CONTROL_DECLARATIONS}
28 in mediump vec2 tc_in[];
29 out mediump float tc_out[];
32 tc_out[gl_InvocationID] = tc_in[gl_InvocationID].x;
33 ${TESSELLATION_CONTROL_OUTPUT}
36 tessellation_evaluation ""
38 ${TESSELLATION_EVALUATION_DECLARATIONS}
39 in mediump float tc_out[];
40 out mediump float te_out;
44 ${TESSELLATION_EVALUATION_OUTPUT}
49 precision mediump float;
50 ${FRAGMENT_DECLARATIONS}
51 in mediump float te_out;
60 case output_type_mismatch
62 desc "Tessellation evaluation shader output type mismatch"
64 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
67 input float in0 = 1.0;
68 output float out0 = 1.0;
72 ${VERTEX_DECLARATIONS}
73 out mediump float tc_in;
80 tessellation_control ""
82 ${TESSELLATION_CONTROL_DECLARATIONS}
83 in mediump float tc_in[];
84 out mediump float tc_out[];
87 tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
88 ${TESSELLATION_CONTROL_OUTPUT}
91 tessellation_evaluation ""
93 ${TESSELLATION_EVALUATION_DECLARATIONS}
94 in mediump float tc_out[];
95 out mediump float te_out;
99 ${TESSELLATION_EVALUATION_OUTPUT}
104 precision mediump float;
105 ${FRAGMENT_DECLARATIONS}
106 in mediump vec2 te_out;
109 out0 = te_out.x + te_out.y;
115 case internal_type_mismatch
117 desc "Tessellation control and evaluation shader varying type mismatch"
119 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
122 input float in0 = 1.0;
123 output float out0 = 1.0;
127 ${VERTEX_DECLARATIONS}
128 out mediump float tc_in;
135 tessellation_control ""
137 ${TESSELLATION_CONTROL_DECLARATIONS}
138 in mediump float tc_in[];
139 out mediump float tc_out[];
142 tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
143 ${TESSELLATION_CONTROL_OUTPUT}
146 tessellation_evaluation ""
148 ${TESSELLATION_EVALUATION_DECLARATIONS}
149 in mediump vec2 tc_out[];
150 out mediump float te_out;
153 te_out = tc_out[2].x + tc_out[0].y;
154 ${TESSELLATION_EVALUATION_OUTPUT}
159 precision mediump float;
160 ${FRAGMENT_DECLARATIONS}
161 in mediump float te_out;
170 case input_different_precision
172 desc "Tessellation control shader input precisions different"
173 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
176 input float in0 = 1.0;
177 output float out0 = 1.0;
181 ${VERTEX_DECLARATIONS}
182 out highp float tc_in;
189 tessellation_control ""
191 ${TESSELLATION_CONTROL_DECLARATIONS}
192 in lowp float tc_in[];
193 out mediump float tc_out[];
196 tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
197 ${TESSELLATION_CONTROL_OUTPUT}
200 tessellation_evaluation ""
202 ${TESSELLATION_EVALUATION_DECLARATIONS}
203 in mediump float tc_out[];
204 out mediump float te_out;
208 ${TESSELLATION_EVALUATION_OUTPUT}
213 precision mediump float;
214 ${FRAGMENT_DECLARATIONS}
215 in mediump float te_out;
224 case output_different_precision
226 desc "Tessellation evaluation shader output precisions different"
227 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
230 input float in0 = 1.0;
231 output float out0 = 1.0;
235 ${VERTEX_DECLARATIONS}
236 out mediump float tc_in;
243 tessellation_control ""
245 ${TESSELLATION_CONTROL_DECLARATIONS}
246 in mediump float tc_in[];
247 out mediump float tc_out[];
250 tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
251 ${TESSELLATION_CONTROL_OUTPUT}
254 tessellation_evaluation ""
256 ${TESSELLATION_EVALUATION_DECLARATIONS}
257 in mediump float tc_out[];
258 out highp float te_out;
262 ${TESSELLATION_EVALUATION_OUTPUT}
267 precision mediump float;
268 ${FRAGMENT_DECLARATIONS}
269 in lowp float te_out;
278 case internal_different_precision
280 desc "Tessellation control and evaluation shader varying precisions different"
281 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
284 input float in0 = 1.0;
285 output float out0 = 1.0;
289 ${VERTEX_DECLARATIONS}
290 out mediump float tc_in;
297 tessellation_control ""
299 ${TESSELLATION_CONTROL_DECLARATIONS}
300 in mediump float tc_in[];
301 out highp float tc_out[];
304 tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
305 ${TESSELLATION_CONTROL_OUTPUT}
308 tessellation_evaluation ""
310 ${TESSELLATION_EVALUATION_DECLARATIONS}
311 in lowp float tc_out[];
312 out mediump float te_out;
316 ${TESSELLATION_EVALUATION_OUTPUT}
321 precision mediump float;
322 ${FRAGMENT_DECLARATIONS}
323 in mediump float te_out;
332 case input_no_declaration
334 desc "Tessellation control shader input with no matching output"
336 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
339 input float in0 = 1.0;
340 output float out0 = 1.0;
344 ${VERTEX_DECLARATIONS}
350 tessellation_control ""
352 ${TESSELLATION_CONTROL_DECLARATIONS}
353 in mediump float tc_in[];
354 out mediump float tc_out[];
357 tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
358 ${TESSELLATION_CONTROL_OUTPUT}
361 tessellation_evaluation ""
363 ${TESSELLATION_EVALUATION_DECLARATIONS}
364 in mediump float tc_out[];
365 out mediump float te_out;
369 ${TESSELLATION_EVALUATION_OUTPUT}
374 precision mediump float;
375 ${FRAGMENT_DECLARATIONS}
376 in mediump float te_out;
385 case output_no_declaration
387 desc "Tessellation evaluation shader without output for an fragment shader input"
389 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
392 output float out0 = 1.0;
396 ${VERTEX_DECLARATIONS}
402 tessellation_control ""
404 ${TESSELLATION_CONTROL_DECLARATIONS}
407 ${TESSELLATION_CONTROL_OUTPUT}
410 tessellation_evaluation ""
412 ${TESSELLATION_EVALUATION_DECLARATIONS}
415 ${TESSELLATION_EVALUATION_OUTPUT}
420 precision mediump float;
421 ${FRAGMENT_DECLARATIONS}
422 in mediump float te_out;
431 case internal_no_declaration
433 desc "Tessellation evaluation shader input without matching output"
435 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
438 output float out0 = 1.0;
442 ${VERTEX_DECLARATIONS}
448 tessellation_control ""
450 ${TESSELLATION_CONTROL_DECLARATIONS}
453 ${TESSELLATION_CONTROL_OUTPUT}
456 tessellation_evaluation ""
458 ${TESSELLATION_EVALUATION_DECLARATIONS}
459 in mediump float tc_out[];
460 out mediump float te_out;
464 ${TESSELLATION_EVALUATION_OUTPUT}
469 precision mediump float;
470 ${FRAGMENT_DECLARATIONS}
471 in mediump float te_out;
480 case input_superfluous_declaration
482 desc "Tessellation control has no input for an output"
483 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
486 input float in0 = 1.0;
487 output float out0 = 1.0;
491 ${VERTEX_DECLARATIONS}
492 out mediump float tc_in;
493 out mediump float tc_in_unused;
497 tc_in_unused = in0 + 1.0;
501 tessellation_control ""
503 ${TESSELLATION_CONTROL_DECLARATIONS}
504 in mediump float tc_in[];
505 out mediump float tc_out[];
508 tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
509 ${TESSELLATION_CONTROL_OUTPUT}
512 tessellation_evaluation ""
514 ${TESSELLATION_EVALUATION_DECLARATIONS}
515 in mediump float tc_out[];
516 out mediump float te_out;
520 ${TESSELLATION_EVALUATION_OUTPUT}
525 precision mediump float;
526 ${FRAGMENT_DECLARATIONS}
527 in mediump float te_out;
536 case output_superfluous_declaration
538 desc "Tessellation has an output without a matching input"
539 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
542 input float in0 = 1.0;
543 output float out0 = 1.0;
547 ${VERTEX_DECLARATIONS}
548 out mediump float tc_in;
555 tessellation_control ""
557 ${TESSELLATION_CONTROL_DECLARATIONS}
558 in mediump float tc_in[];
559 out mediump float tc_out[];
562 tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
563 ${TESSELLATION_CONTROL_OUTPUT}
566 tessellation_evaluation ""
568 ${TESSELLATION_EVALUATION_DECLARATIONS}
569 in mediump float tc_out[];
570 out mediump float te_out;
571 out mediump float te_out_unused;
575 te_out_unused = tc_out[0];
576 ${TESSELLATION_EVALUATION_OUTPUT}
581 precision mediump float;
582 ${FRAGMENT_DECLARATIONS}
583 in mediump float te_out;
592 case internal_superfluous_declaration
594 desc "Tessellation control has an output without a matching input"
595 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
598 input float in0 = 1.0;
599 output float out0 = 1.0;
603 ${VERTEX_DECLARATIONS}
604 out mediump float tc_in;
611 tessellation_control ""
613 ${TESSELLATION_CONTROL_DECLARATIONS}
614 in mediump float tc_in[];
615 out mediump float tc_out[];
616 out mediump float tc_out_unused[];
619 tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
620 tc_out_unused[gl_InvocationID] = tc_in[gl_InvocationID] + 1.0;
621 ${TESSELLATION_CONTROL_OUTPUT}
624 tessellation_evaluation ""
626 ${TESSELLATION_EVALUATION_DECLARATIONS}
627 in mediump float tc_out[];
628 out mediump float te_out;
632 ${TESSELLATION_EVALUATION_OUTPUT}
637 precision mediump float;
638 ${FRAGMENT_DECLARATIONS}
639 in mediump float te_out;
648 case vertex_fragment_same_varying_name_1
650 desc "Tessellation control has an output without a matching input"
651 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
654 input float in0 = 1.0;
655 output float out0 = 2.0;
659 ${VERTEX_DECLARATIONS}
660 out mediump float sharedVaringName;
663 sharedVaringName = in0;
667 tessellation_control ""
669 ${TESSELLATION_CONTROL_DECLARATIONS}
670 in mediump float sharedVaringName[];
671 out mediump float tc_out[];
674 tc_out[gl_InvocationID] = sharedVaringName[gl_InvocationID];
675 ${TESSELLATION_CONTROL_OUTPUT}
678 tessellation_evaluation ""
680 ${TESSELLATION_EVALUATION_DECLARATIONS}
681 in mediump float tc_out[];
682 out mediump float sharedVaringName;
685 sharedVaringName = 2.0 * tc_out[2];
686 ${TESSELLATION_EVALUATION_OUTPUT}
691 precision mediump float;
692 ${FRAGMENT_DECLARATIONS}
693 in mediump float sharedVaringName;
696 out0 = sharedVaringName;
702 case vertex_fragment_same_varying_name_2
704 desc "Tessellation control has an output without a matching input"
705 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
708 input vec2 in0 = vec2(1.0, 3.0);
709 output float out0 = 4.0;
713 ${VERTEX_DECLARATIONS}
714 out mediump vec2 sharedVaringName;
717 sharedVaringName = in0;
721 tessellation_control ""
723 ${TESSELLATION_CONTROL_DECLARATIONS}
724 in mediump vec2 sharedVaringName[];
725 out mediump float tc_out[];
728 tc_out[gl_InvocationID] = sharedVaringName[gl_InvocationID].x + sharedVaringName[gl_InvocationID].y;
729 ${TESSELLATION_CONTROL_OUTPUT}
732 tessellation_evaluation ""
734 ${TESSELLATION_EVALUATION_DECLARATIONS}
735 in mediump float tc_out[];
736 out mediump float sharedVaringName;
739 sharedVaringName = tc_out[2];
740 ${TESSELLATION_EVALUATION_OUTPUT}
745 precision mediump float;
746 ${FRAGMENT_DECLARATIONS}
747 in mediump float sharedVaringName;
750 out0 = sharedVaringName;
756 case invalid_vertex_index
758 desc "Tessellation control output not indexed with gl_InvocationID"
759 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
760 expect compile_or_link_fail
763 ${VERTEX_DECLARATIONS}
769 tessellation_control ""
771 ${TESSELLATION_CONTROL_DECLARATIONS}
772 out mediump float tc_out[];
775 tc_out[2 - gl_InvocationID] = float(gl_InvocationID);
776 ${TESSELLATION_CONTROL_OUTPUT}
779 tessellation_evaluation ""
781 ${TESSELLATION_EVALUATION_DECLARATIONS}
782 in mediump float tc_out[];
783 out mediump float te_out;
787 ${TESSELLATION_EVALUATION_OUTPUT}
792 precision mediump float;
793 ${FRAGMENT_DECLARATIONS}
794 in mediump float te_out;
797 ${FRAG_COLOR} = vec4(te_out);
804 desc "Tessellation control input in not an array"
805 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
806 expect compile_or_link_fail
809 input float in0 = 1.0;
810 output float out0 = 1.0;
814 ${VERTEX_DECLARATIONS}
815 out mediump float tc_in;
822 tessellation_control ""
824 ${TESSELLATION_CONTROL_DECLARATIONS}
825 in mediump float tc_in;
826 out mediump float tc_out[];
829 tc_out[gl_InvocationID] = tc_in;
830 ${TESSELLATION_CONTROL_OUTPUT}
833 tessellation_evaluation ""
835 ${TESSELLATION_EVALUATION_DECLARATIONS}
836 in mediump float tc_out[];
837 out mediump float te_out;
841 ${TESSELLATION_EVALUATION_OUTPUT}
846 precision mediump float;
847 ${FRAGMENT_DECLARATIONS}
848 in mediump float te_out;
857 case input_array_size_mismatch
859 desc "Tessellation control input array size is not gl_MaxPatchVertices"
860 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
861 expect compile_or_link_fail
864 input float in0 = 1.0;
865 output float out0 = 1.0;
869 ${VERTEX_DECLARATIONS}
870 out mediump float tc_in;
877 tessellation_control ""
879 ${TESSELLATION_CONTROL_DECLARATIONS}
880 in mediump float tc_in[2]; // not gl_MaxPatchVertices
881 out mediump float tc_out[];
884 tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
885 ${TESSELLATION_CONTROL_OUTPUT}
888 tessellation_evaluation ""
890 ${TESSELLATION_EVALUATION_DECLARATIONS}
891 in mediump float tc_out[];
892 out mediump float te_out;
896 ${TESSELLATION_EVALUATION_OUTPUT}
901 precision mediump float;
902 ${FRAGMENT_DECLARATIONS}
903 in mediump float te_out;
912 case internal_array_size_mismatch
914 desc "Tessellation control output array size is not consistent with layout qualifier"
915 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
916 expect compile_or_link_fail
919 input float in0 = 1.0;
920 output float out0 = 1.0;
924 ${VERTEX_DECLARATIONS}
925 out mediump float tc_in;
932 tessellation_control ""
934 ${TESSELLATION_CONTROL_DECLARATIONS}
935 in mediump float tc_in[];
936 out mediump float tc_out[2]; // does not match output layout qualifier
939 tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
940 ${TESSELLATION_CONTROL_OUTPUT}
943 tessellation_evaluation ""
945 ${TESSELLATION_EVALUATION_DECLARATIONS}
946 in mediump float tc_out[2];
947 out mediump float te_out;
951 ${TESSELLATION_EVALUATION_OUTPUT}
956 precision mediump float;
957 ${FRAGMENT_DECLARATIONS}
958 in mediump float te_out;
967 case per_patch_qualifier_mismatch_1
969 desc "Tessellation control output is per-patch qualified, evaluation input is not"
970 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
971 expect compile_or_link_fail
974 input float in0 = 1.0;
975 output float out0 = 1.0;
979 ${VERTEX_DECLARATIONS}
980 out mediump float tc_in;
987 tessellation_control ""
989 ${TESSELLATION_CONTROL_DECLARATIONS}
990 in mediump float tc_in[];
991 patch out mediump float tc_out[gl_MaxPatchVertices];
994 tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
995 ${TESSELLATION_CONTROL_OUTPUT}
998 tessellation_evaluation ""
1000 ${TESSELLATION_EVALUATION_DECLARATIONS}
1001 in mediump float tc_out[gl_MaxPatchVertices];
1002 out mediump float te_out;
1006 ${TESSELLATION_EVALUATION_OUTPUT}
1011 precision mediump float;
1012 ${FRAGMENT_DECLARATIONS}
1013 in mediump float te_out;
1022 case per_patch_qualifier_mismatch_2
1024 desc "Tessellation control output is not per-patch qualified, evaluation input is"
1025 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
1026 expect compile_or_link_fail
1029 input float in0 = 1.0;
1030 output float out0 = 1.0;
1034 ${VERTEX_DECLARATIONS}
1035 out mediump float tc_in;
1042 tessellation_control ""
1044 ${TESSELLATION_CONTROL_DECLARATIONS}
1045 in mediump float tc_in[];
1046 out mediump float tc_out[gl_MaxPatchVertices];
1049 tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
1050 ${TESSELLATION_CONTROL_OUTPUT}
1053 tessellation_evaluation ""
1055 ${TESSELLATION_EVALUATION_DECLARATIONS}
1056 patch in mediump float tc_out[gl_MaxPatchVertices];
1057 out mediump float te_out;
1061 ${TESSELLATION_EVALUATION_OUTPUT}
1066 precision mediump float;
1067 ${FRAGMENT_DECLARATIONS}
1068 in mediump float te_out;
1079 desc "Tessellation control shader input block"
1080 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
1081 require extension { "GL_OES_shader_io_blocks" | "GL_EXT_shader_io_blocks" } in { vertex }
1082 values { output float out0 = 1.0; }
1085 ${VERTEX_DECLARATIONS}
1089 } outputInstanceName;
1092 outputInstanceName.var = 1.0;
1096 tessellation_control ""
1098 ${TESSELLATION_CONTROL_DECLARATIONS}
1102 } inputInstanceName[];
1103 out mediump float tc_out[];
1106 tc_out[gl_InvocationID] = inputInstanceName[gl_InvocationID].var;
1107 ${TESSELLATION_CONTROL_OUTPUT}
1110 tessellation_evaluation ""
1112 ${TESSELLATION_EVALUATION_DECLARATIONS}
1113 in mediump float tc_out[];
1114 out mediump float te_out;
1118 ${TESSELLATION_EVALUATION_OUTPUT}
1123 precision mediump float;
1124 ${FRAGMENT_DECLARATIONS}
1125 in mediump float te_out;
1134 case input_block_non_array
1136 desc "Tessellation control shader input block with explicit array"
1137 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
1138 require extension { "GL_OES_shader_io_blocks" | "GL_EXT_shader_io_blocks" } in { vertex }
1139 expect compile_or_link_fail
1140 values { output float out0 = 1.0; }
1143 ${VERTEX_DECLARATIONS}
1147 } outputInstanceName;
1150 outputInstanceName.var = 1.0;
1154 tessellation_control ""
1156 ${TESSELLATION_CONTROL_DECLARATIONS}
1160 } inputInstanceName;
1161 out mediump float tc_out[];
1164 tc_out[gl_InvocationID] = inputInstanceName.var;
1165 ${TESSELLATION_CONTROL_OUTPUT}
1168 tessellation_evaluation ""
1170 ${TESSELLATION_EVALUATION_DECLARATIONS}
1171 in mediump float tc_out[];
1172 out mediump float te_out;
1176 ${TESSELLATION_EVALUATION_OUTPUT}
1181 precision mediump float;
1182 ${FRAGMENT_DECLARATIONS}
1183 in mediump float geo_out;
1192 case input_block_array_size_mismatch
1194 desc "Tessellation control shader input block array, size not gl_MaxPatchVertices"
1195 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
1196 require extension { "GL_OES_shader_io_blocks" | "GL_EXT_shader_io_blocks" } in { vertex }
1197 expect compile_or_link_fail
1198 values { output float out0 = 1.0; }
1201 ${VERTEX_DECLARATIONS}
1205 } outputInstanceName;
1208 outputInstanceName.var = 1.0;
1212 tessellation_control ""
1214 ${TESSELLATION_CONTROL_DECLARATIONS}
1218 } inputInstanceName[4]; // not gl_MaxPatchVertices
1219 out mediump float tc_out[];
1222 tc_out[gl_InvocationID] = inputInstanceName[gl_InvocationID + 1].var;
1223 ${TESSELLATION_CONTROL_OUTPUT}
1226 tessellation_evaluation ""
1228 ${TESSELLATION_EVALUATION_DECLARATIONS}
1229 in mediump float tc_out[];
1230 out mediump float te_out;
1234 ${TESSELLATION_EVALUATION_OUTPUT}
1239 precision mediump float;
1240 ${FRAGMENT_DECLARATIONS}
1241 in mediump float geo_out;
1252 desc "Tessellation shader output block"
1253 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
1254 require extension { "GL_OES_shader_io_blocks" | "GL_EXT_shader_io_blocks" } in { fragment }
1255 values { output float out0 = 1.0; }
1258 ${VERTEX_DECLARATIONS}
1264 tessellation_control ""
1266 ${TESSELLATION_CONTROL_DECLARATIONS}
1269 ${TESSELLATION_CONTROL_OUTPUT}
1272 tessellation_evaluation ""
1274 ${TESSELLATION_EVALUATION_DECLARATIONS}
1278 } outputInstanceName;
1281 outputInstanceName.var = 1.0;
1282 ${TESSELLATION_EVALUATION_OUTPUT}
1287 precision mediump float;
1288 ${FRAGMENT_DECLARATIONS}
1292 } inputInstanceName;
1295 out0 = inputInstanceName.var;
1301 case output_block_array
1303 desc "Tessellation shader output block array"
1304 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
1305 require extension { "GL_OES_shader_io_blocks" | "GL_EXT_shader_io_blocks" } in { fragment }
1306 values { output float out0 = 1.0; }
1309 ${VERTEX_DECLARATIONS}
1315 tessellation_control ""
1317 ${TESSELLATION_CONTROL_DECLARATIONS}
1320 ${TESSELLATION_CONTROL_OUTPUT}
1323 tessellation_evaluation ""
1325 ${TESSELLATION_EVALUATION_DECLARATIONS}
1329 } outputInstanceName[2];
1332 outputInstanceName[0].var = 2.0;
1333 outputInstanceName[1].var = 1.0;
1334 ${TESSELLATION_EVALUATION_OUTPUT}
1339 precision mediump float;
1340 ${FRAGMENT_DECLARATIONS}
1344 } inputInstanceName[2];
1347 out0 = inputInstanceName[0].var - inputInstanceName[1].var;
1353 case unspecified_vertex_count
1355 desc "Tessellation shader unspecified vertex count"
1356 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
1357 expect compile_or_link_fail
1360 ${VERTEX_DECLARATIONS}
1366 tessellation_control ""
1370 ${TESSELLATION_CONTROL_OUTPUT}
1373 tessellation_evaluation ""
1375 ${TESSELLATION_EVALUATION_DECLARATIONS}
1378 ${TESSELLATION_EVALUATION_OUTPUT}
1383 precision mediump float;
1384 ${FRAGMENT_DECLARATIONS}
1392 case unspecified_primitive_mode
1394 desc "Tessellation shader unspecified vertex count"
1395 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
1396 expect compile_or_link_fail
1399 ${VERTEX_DECLARATIONS}
1405 tessellation_control ""
1407 ${TESSELLATION_CONTROL_DECLARATIONS}
1410 ${TESSELLATION_CONTROL_OUTPUT}
1413 tessellation_evaluation ""
1417 ${TESSELLATION_EVALUATION_OUTPUT}
1422 precision mediump float;
1423 ${FRAGMENT_DECLARATIONS}
1432 group qualifiers "Varying qualifiers"
1435 desc "Smooth varying"
1436 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
1439 input float in0 = 1.0;
1440 output float out0 = 1.0;
1444 ${VERTEX_DECLARATIONS}
1445 smooth out mediump float tc_in;
1452 tessellation_control ""
1454 ${TESSELLATION_CONTROL_DECLARATIONS}
1455 smooth in mediump float tc_in[];
1456 smooth out mediump float tc_out[];
1459 tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
1460 ${TESSELLATION_CONTROL_OUTPUT}
1463 tessellation_evaluation ""
1465 ${TESSELLATION_EVALUATION_DECLARATIONS}
1466 smooth in mediump float tc_out[];
1467 smooth out mediump float te_out;
1471 ${TESSELLATION_EVALUATION_OUTPUT}
1476 precision mediump float;
1477 ${FRAGMENT_DECLARATIONS}
1478 smooth in mediump float te_out;
1490 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
1493 input float in0 = 1.0;
1494 output float out0 = 1.0;
1498 ${VERTEX_DECLARATIONS}
1499 flat out mediump float tc_in;
1506 tessellation_control ""
1508 ${TESSELLATION_CONTROL_DECLARATIONS}
1509 flat in mediump float tc_in[];
1510 flat out mediump float tc_out[];
1513 tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
1514 ${TESSELLATION_CONTROL_OUTPUT}
1517 tessellation_evaluation ""
1519 ${TESSELLATION_EVALUATION_DECLARATIONS}
1520 flat in mediump float tc_out[];
1521 flat out mediump float te_out;
1525 ${TESSELLATION_EVALUATION_OUTPUT}
1530 precision mediump float;
1531 ${FRAGMENT_DECLARATIONS}
1532 flat in mediump float te_out;
1543 desc "Centroid varying"
1544 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
1547 input float in0 = 1.0;
1548 output float out0 = 1.0;
1552 ${VERTEX_DECLARATIONS}
1553 centroid out mediump float tc_in;
1560 tessellation_control ""
1562 ${TESSELLATION_CONTROL_DECLARATIONS}
1563 centroid in mediump float tc_in[];
1564 centroid out mediump float tc_out[];
1567 tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
1568 ${TESSELLATION_CONTROL_OUTPUT}
1571 tessellation_evaluation ""
1573 ${TESSELLATION_EVALUATION_DECLARATIONS}
1574 centroid in mediump float tc_out[];
1575 centroid out mediump float te_out;
1579 ${TESSELLATION_EVALUATION_OUTPUT}
1584 precision mediump float;
1585 ${FRAGMENT_DECLARATIONS}
1586 centroid in mediump float te_out;
1597 desc "Sample varying"
1598 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
1599 require extension { "GL_OES_shader_multisample_interpolation" }
1602 input float in0 = 1.0;
1603 output float out0 = 1.0;
1607 ${VERTEX_DECLARATIONS}
1608 sample out mediump float tc_in;
1615 tessellation_control ""
1617 ${TESSELLATION_CONTROL_DECLARATIONS}
1618 sample in mediump float tc_in[];
1619 sample out mediump float tc_out[];
1622 tc_out[gl_InvocationID] = tc_in[gl_InvocationID];
1623 ${TESSELLATION_CONTROL_OUTPUT}
1626 tessellation_evaluation ""
1628 ${TESSELLATION_EVALUATION_DECLARATIONS}
1629 sample in mediump float tc_out[];
1630 sample out mediump float te_out;
1634 ${TESSELLATION_EVALUATION_OUTPUT}
1639 precision mediump float;
1640 ${FRAGMENT_DECLARATIONS}
1641 sample in mediump float te_out;
1652 desc "Pre-patch varying"
1653 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
1656 input float in0 = 1.0;
1657 output float out0 = 1.0;
1661 ${VERTEX_DECLARATIONS}
1662 out mediump float tc_in;
1669 tessellation_control ""
1671 ${TESSELLATION_CONTROL_DECLARATIONS}
1672 in mediump float tc_in[];
1673 patch out mediump float tc_out;
1676 tc_out = tc_in[gl_InvocationID];
1677 ${TESSELLATION_CONTROL_OUTPUT}
1680 tessellation_evaluation ""
1682 ${TESSELLATION_EVALUATION_DECLARATIONS}
1683 patch in mediump float tc_out;
1684 out mediump float te_out;
1688 ${TESSELLATION_EVALUATION_OUTPUT}
1693 precision mediump float;
1694 ${FRAGMENT_DECLARATIONS}
1695 in mediump float te_out;
1705 import "linkage_tessellation_varying_types.test"
1708 group uniform "Uniform"
1710 case type_mismatch_1
1712 desc "uniform type mismatch between vertex and tessellation control shaders"
1714 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
1717 ${VERTEX_DECLARATIONS}
1718 uniform mediump float val;
1719 out mediump float vtx_out;
1726 tessellation_control ""
1728 ${TESSELLATION_CONTROL_DECLARATIONS}
1729 uniform mediump vec2 val;
1730 in mediump float vtx_out[];
1731 out mediump float tc_out[];
1734 tc_out[gl_InvocationID] = vtx_out[0] + val.x + val.y;
1735 ${TESSELLATION_CONTROL_OUTPUT}
1738 tessellation_evaluation ""
1740 ${TESSELLATION_EVALUATION_DECLARATIONS}
1741 in mediump float tc_out[];
1742 out mediump float te_out;
1746 ${TESSELLATION_EVALUATION_OUTPUT}
1751 precision mediump float;
1752 ${FRAGMENT_DECLARATIONS}
1753 in mediump float te_out;
1756 ${FRAG_COLOR} = vec4(te_out);
1761 case type_mismatch_2
1763 desc "uniform type mismatch between fragment and tessellation eval shaders"
1765 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
1768 ${VERTEX_DECLARATIONS}
1769 out mediump float vtx_out;
1775 tessellation_control ""
1777 ${TESSELLATION_CONTROL_DECLARATIONS}
1780 ${TESSELLATION_CONTROL_OUTPUT}
1783 tessellation_evaluation ""
1785 ${TESSELLATION_EVALUATION_DECLARATIONS}
1786 uniform mediump vec3 val;
1787 out mediump float te_out;
1790 te_out = val.x + val.y + val.z;
1791 ${TESSELLATION_EVALUATION_OUTPUT}
1796 precision mediump float;
1797 ${FRAGMENT_DECLARATIONS}
1798 uniform mediump vec4 val;
1799 in mediump float te_out;
1802 ${FRAG_COLOR} = vec4(te_out) + val;
1807 case type_mismatch_3
1809 desc "uniform type mismatch between tessellation control and eval shaders"
1811 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
1814 ${VERTEX_DECLARATIONS}
1815 out mediump float vtx_out;
1821 tessellation_control ""
1823 ${TESSELLATION_CONTROL_DECLARATIONS}
1824 uniform mediump vec4 val;
1825 out mediump vec4 tc_out[];
1828 tc_out[gl_InvocationID] = val;
1829 ${TESSELLATION_CONTROL_OUTPUT}
1832 tessellation_evaluation ""
1834 ${TESSELLATION_EVALUATION_DECLARATIONS}
1835 uniform mediump vec3 val;
1836 in mediump vec4 tc_out[];
1837 out mediump float te_out;
1840 te_out = tc_out[0].w * val.z;
1841 ${TESSELLATION_EVALUATION_OUTPUT}
1846 precision mediump float;
1847 ${FRAGMENT_DECLARATIONS}
1848 in mediump float te_out;
1851 ${FRAG_COLOR} = vec4(te_out);
1856 case type_mismatch_4
1858 desc "uniform type mismatch between vertex and tessellation control shaders"
1860 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
1861 require limit "GL_MAX_VERTEX_ATOMIC_COUNTERS" > 0
1864 ${VERTEX_DECLARATIONS}
1865 layout(binding=0) uniform atomic_uint u_var;
1866 out mediump float vtx_out;
1869 uint result = atomicCounterIncrement(u_var);
1870 vtx_out = float(result);
1874 tessellation_control ""
1876 ${TESSELLATION_CONTROL_DECLARATIONS}
1877 uniform mediump float u_var;
1878 in mediump float vtx_out[];
1879 out mediump float tc_out[];
1882 tc_out[gl_InvocationID] = vtx_out[0] + u_var;
1883 ${TESSELLATION_CONTROL_OUTPUT}
1886 tessellation_evaluation ""
1888 ${TESSELLATION_EVALUATION_DECLARATIONS}
1889 in mediump float tc_out[];
1890 out mediump float te_out;
1894 ${TESSELLATION_EVALUATION_OUTPUT}
1899 precision mediump float;
1900 ${FRAGMENT_DECLARATIONS}
1901 in mediump float te_out;
1904 ${FRAG_COLOR} = vec4(te_out);
1909 case type_mismatch_5
1911 desc "uniform type mismatch between vertex and tessellation control shaders"
1913 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
1914 require limit "GL_MAX_VERTEX_IMAGE_UNIFORMS" > 0
1917 ${VERTEX_DECLARATIONS}
1918 layout(binding=0) layout(rgba8i) uniform readonly highp iimage2D u_var;
1919 out mediump float vtx_out;
1922 int result = imageSize(u_var).x;
1923 vtx_out = float(result);
1927 tessellation_control ""
1929 ${TESSELLATION_CONTROL_DECLARATIONS}
1930 uniform mediump float u_var;
1931 in mediump float vtx_out[];
1932 out mediump float tc_out[];
1935 tc_out[gl_InvocationID] = vtx_out[0] + u_var;
1936 ${TESSELLATION_CONTROL_OUTPUT}
1939 tessellation_evaluation ""
1941 ${TESSELLATION_EVALUATION_DECLARATIONS}
1942 in mediump float tc_out[];
1943 out mediump float te_out;
1947 ${TESSELLATION_EVALUATION_OUTPUT}
1952 precision mediump float;
1953 ${FRAGMENT_DECLARATIONS}
1954 in mediump float te_out;
1957 ${FRAG_COLOR} = vec4(te_out);
1962 case precision_mismatch_1
1964 desc "uniform precision mismatch between tessellation control and eval shaders"
1966 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
1969 ${VERTEX_DECLARATIONS}
1970 out mediump float vtx_out;
1976 tessellation_control ""
1978 ${TESSELLATION_CONTROL_DECLARATIONS}
1979 uniform mediump vec4 val;
1980 out mediump vec4 tc_out[];
1983 tc_out[gl_InvocationID] = val;
1984 ${TESSELLATION_CONTROL_OUTPUT}
1987 tessellation_evaluation ""
1989 ${TESSELLATION_EVALUATION_DECLARATIONS}
1990 uniform highp vec4 val;
1991 in mediump vec4 tc_out[];
1992 out mediump float te_out;
1995 te_out = tc_out[0].w * val.z;
1996 ${TESSELLATION_EVALUATION_OUTPUT}
2001 precision mediump float;
2002 ${FRAGMENT_DECLARATIONS}
2003 in mediump float te_out;
2006 ${FRAG_COLOR} = vec4(te_out);
2011 case precision_mismatch_2
2013 desc "uniform precision mismatch between vertex and tessellation control shaders"
2015 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
2018 ${VERTEX_DECLARATIONS}
2019 uniform highp float val;
2020 out mediump float vtx_out;
2027 tessellation_control ""
2029 ${TESSELLATION_CONTROL_DECLARATIONS}
2030 uniform mediump float val;
2031 in mediump float vtx_out[];
2032 out mediump float tc_out[];
2035 tc_out[gl_InvocationID] = vtx_out[0] + val;
2036 ${TESSELLATION_CONTROL_OUTPUT}
2039 tessellation_evaluation ""
2041 ${TESSELLATION_EVALUATION_DECLARATIONS}
2042 in mediump float tc_out[];
2043 out mediump float te_out;
2047 ${TESSELLATION_EVALUATION_OUTPUT}
2052 precision mediump float;
2053 ${FRAGMENT_DECLARATIONS}
2054 in mediump float te_out;
2057 ${FRAG_COLOR} = vec4(te_out);
2062 case struct_partial_usage
2064 desc "uniform is partially used in different shader stages"
2065 require extension { "GL_OES_tessellation_shader" | "GL_EXT_tessellation_shader" } in { tessellation_control, tessellation_evaluation }
2068 uniform float val.vtxVal = 1.5;
2069 uniform float val.tcVal = 2.5;
2070 uniform float val.teVal = 6.0;
2071 uniform float val.fragVal = 11.0;
2072 output float out0 = 68.5;
2076 ${VERTEX_DECLARATIONS}
2079 mediump float vtxVal;
2080 mediump float tcVal;
2081 mediump float teVal;
2082 mediump float fragVal;
2085 out mediump float vtx_out;
2088 vtx_out = val.vtxVal;
2092 tessellation_control ""
2094 ${TESSELLATION_CONTROL_DECLARATIONS}
2097 mediump float vtxVal;
2098 mediump float tcVal;
2099 mediump float teVal;
2100 mediump float fragVal;
2103 in mediump float vtx_out[];
2104 out mediump float tc_out[];
2107 tc_out[gl_InvocationID] = vtx_out[0] + 2.0 * val.tcVal;
2108 ${TESSELLATION_CONTROL_OUTPUT}
2111 tessellation_evaluation ""
2113 ${TESSELLATION_EVALUATION_DECLARATIONS}
2116 mediump float vtxVal;
2117 mediump float tcVal;
2118 mediump float teVal;
2119 mediump float fragVal;
2122 in mediump float tc_out[];
2123 out mediump float te_out;
2126 te_out = tc_out[2] + 3.0 * val.teVal;
2127 ${TESSELLATION_EVALUATION_OUTPUT}
2132 precision mediump float;
2133 ${FRAGMENT_DECLARATIONS}
2136 mediump float vtxVal;
2137 mediump float tcVal;
2138 mediump float teVal;
2139 mediump float fragVal;
2142 in mediump float te_out;
2145 out0 = te_out + 4.0 * val.fragVal;
2152 import "linkage_tessellation_uniform_types.test"