1 2 # Varying tests 3 group varying "Varying linkage" 4 5 # Linking rules 6 group rules "Varying linking rules" 7 # not declared in vertex shader, declared in fragment shader 8 case fragment_declare 9 version 300 es 10 desc "varying declared in fragment shader, no reference in vertex shader" 11 values { output float out0 = 1.0; } 12 vertex "" 13 #version 300 es 14 ${VERTEX_DECLARATIONS} 15 void main() 16 { 17 ${VERTEX_OUTPUT} 18 } 19 "" 20 fragment "" 21 #version 300 es 22 precision mediump float; 23 in mediump float var; 24 ${FRAGMENT_DECLARATIONS} 25 void main() 26 { 27 out0 = 1.0; 28 ${FRAGMENT_OUTPUT} 29 } 30 "" 31 end 32 33 # declared in vertex shader, no reference in frag shader 34 case vertex_declare 35 version 300 es 36 desc "varying declared in vertex shader, no reference in fragment shader" 37 vertex "" 38 #version 300 es 39 ${VERTEX_DECLARATIONS} 40 out mediump float var; 41 void main() 42 { 43 ${VERTEX_OUTPUT} 44 } 45 "" 46 fragment "" 47 #version 300 es 48 ${FRAGMENT_DECLARATIONS} 49 void main() 50 { 51 ${FRAG_COLOR} = vec4(1.0); 52 } 53 "" 54 end 55 56 # declared in vertex shader, declared in frag shader 57 case both_declare 58 version 300 es 59 desc "varying declared in both vertex and fragment shader, but not used" 60 vertex "" 61 #version 300 es 62 ${VERTEX_DECLARATIONS} 63 out mediump float var; 64 void main() 65 { 66 ${VERTEX_OUTPUT} 67 } 68 "" 69 fragment "" 70 #version 300 es 71 in mediump float var; 72 ${FRAGMENT_DECLARATIONS} 73 void main() 74 { 75 ${FRAG_COLOR} = vec4(1.0); 76 } 77 "" 78 end 79 80 # declared in vertex shader, static use in frag shader 81 case vertex_declare_fragment_use 82 version 300 es 83 desc "varying declared in both shaders, statically used in fragment shader" 84 values { uniform bool u_false = false; } 85 vertex "" 86 #version 300 es 87 ${VERTEX_DECLARATIONS} 88 out mediump float var; 89 void main() 90 { 91 ${VERTEX_OUTPUT} 92 } 93 "" 94 fragment "" 95 #version 300 es 96 in mediump float var; 97 ${FRAGMENT_DECLARATIONS} 98 void main() 99 { 100 if (u_false) 101 ${FRAG_COLOR} = vec4(var); 102 else 103 ${FRAG_COLOR} = vec4(1.0); 104 } 105 "" 106 end 107 108 # static use in vertex shader, no reference in fragment shader 109 case vertex_use_fragment_declare 110 version 300 es 111 desc "varying declared and statically used in vertex shader, no reference in fragment shader" 112 values { uniform bool u_false = false; } 113 vertex "" 114 #version 300 es 115 ${VERTEX_DECLARATIONS} 116 out mediump float var; 117 void main() 118 { 119 if (u_false) 120 var = 1.0; 121 ${VERTEX_OUTPUT} 122 } 123 "" 124 fragment "" 125 #version 300 es 126 ${FRAGMENT_DECLARATIONS} 127 void main() 128 { 129 ${FRAG_COLOR} = vec4(1.0); 130 } 131 "" 132 end 133 134 # static use in vertex shader, declared in fragment shader 135 case vertex_use_declare_fragment 136 version 300 es 137 desc "varying declared and statically used in vertex shader, only declared in fragment shader" 138 values { uniform bool u_false = false; } 139 vertex "" 140 #version 300 es 141 ${VERTEX_DECLARATIONS} 142 out mediump float var; 143 void main() 144 { 145 if (u_false) 146 var = 1.0; 147 ${VERTEX_OUTPUT} 148 } 149 "" 150 fragment "" 151 #version 300 es 152 in mediump float var; 153 ${FRAGMENT_DECLARATIONS} 154 void main() 155 { 156 ${FRAG_COLOR} = vec4(1.0); 157 } 158 "" 159 end 160 161 # static use in vertex shader, used in fragment shader 162 case vertex_use_fragment_use 163 version 300 es 164 desc "varying statically used in both vertex and fragment shader" 165 values { uniform bool u_false = false; } 166 vertex "" 167 #version 300 es 168 ${VERTEX_DECLARATIONS} 169 out mediump float var; 170 void main() 171 { 172 if (u_false) 173 var = 1.0; 174 ${VERTEX_OUTPUT} 175 } 176 "" 177 fragment "" 178 #version 300 es 179 ${FRAGMENT_DECLARATIONS} 180 in mediump float var; 181 void main() 182 { 183 if (u_false) 184 ${FRAG_COLOR} = vec4(var); 185 else 186 ${FRAG_COLOR} = vec4(1.0); 187 } 188 "" 189 end 190 191 # differing precision tests 192 case differing_precision_1 193 version 300 es 194 desc "varying declared as highp in vertex shader, but mediump in fragment shader" 195 values 196 { 197 input float in0 = [ -1.25 | -25.55 | 1.0 | 2.25 | 3.4 | 16.0 ]; 198 output float out0 = [ -1.25 | -25.55 | 1.0 | 2.25 | 3.4 | 16.0 ]; 199 } 200 201 vertex "" 202 #version 300 es 203 ${VERTEX_DECLARATIONS} 204 out highp float var; 205 void main() 206 { 207 var = in0; 208 ${VERTEX_OUTPUT} 209 } 210 "" 211 fragment "" 212 #version 300 es 213 precision mediump float; 214 ${FRAGMENT_DECLARATIONS} 215 in mediump float var; 216 void main() 217 { 218 out0 = var; 219 ${FRAGMENT_OUTPUT} 220 } 221 "" 222 end 223 224 # differing precision tests 225 case differing_precision_2 226 version 300 es 227 desc "varying declared as highp in vertex shader, but lowp in fragment shader" 228 values 229 { 230 input float in0 = [ -1.25 | -25.56 | 1.0 | 2.25 | 3.4 | 16.0 ]; 231 output float out0 = [ -1.25 | -25.56 | 1.0 | 2.25 | 3.4 | 16.0 ]; 232 } 233 234 vertex "" 235 #version 300 es 236 ${VERTEX_DECLARATIONS} 237 out highp vec2 var; 238 void main() 239 { 240 var = vec2(in0, 2.0*in0); 241 ${VERTEX_OUTPUT} 242 } 243 "" 244 fragment "" 245 #version 300 es 246 precision mediump float; 247 ${FRAGMENT_DECLARATIONS} 248 in lowp vec2 var; 249 void main() 250 { 251 out0 = var.y - var.x; 252 ${FRAGMENT_OUTPUT} 253 } 254 "" 255 end 256 257 # differing precision tests 258 case differing_precision_3 259 version 300 es 260 desc "varying declared as lowp in vertex shader, but mediump in fragment shader" 261 values 262 { 263 input float in0 = [ -1.25 | -25.0 | 1.0 | 2.25 | 3.4 | 16.0 ]; 264 output float out0 = [ -1.25 | -25.0 | 1.0 | 2.25 | 3.4 | 16.0 ]; 265 } 266 267 vertex "" 268 #version 300 es 269 ${VERTEX_DECLARATIONS} 270 out lowp vec4 var; 271 void main() 272 { 273 var = vec4(in0, 2.0*in0, -in0, -in0); 274 ${VERTEX_OUTPUT} 275 } 276 "" 277 fragment "" 278 #version 300 es 279 precision mediump float; 280 ${FRAGMENT_DECLARATIONS} 281 in mediump vec4 var; 282 void main() 283 { 284 out0 = var.x + var.y + var.z + var.w; 285 ${FRAGMENT_OUTPUT} 286 } 287 "" 288 end 289 290 # mismatched type, static use but no runtime use in the fragment shader 291 case type_mismatch_1 292 version 300 es 293 desc "varying type mismatch (float vs. vec2), static use but no runtime use in the fragment shader" 294 expect link_fail 295 vertex "" 296 #version 300 es 297 ${VERTEX_DECLARATIONS} 298 out mediump float var; 299 void main() 300 { 301 var = 2.0; 302 ${VERTEX_OUTPUT} 303 } 304 "" 305 fragment "" 306 #version 300 es 307 ${FRAGMENT_DECLARATIONS} 308 in mediump vec2 var; 309 void main() 310 { 311 if (false) 312 { 313 ${FRAG_COLOR} = vec4(var.y); 314 } 315 else 316 { 317 ${FRAG_COLOR} = vec4(1.0); 318 } 319 } 320 "" 321 end 322 323 # mismatched type, varyings used 324 case type_mismatch_2 325 version 300 es 326 desc "varying type mismatch (float vs. vec2)" 327 expect link_fail 328 vertex "" 329 #version 300 es 330 ${VERTEX_DECLARATIONS} 331 out mediump float var; 332 void main() 333 { 334 var = 2.0; 335 ${VERTEX_OUTPUT} 336 } 337 "" 338 fragment "" 339 #version 300 es 340 ${FRAGMENT_DECLARATIONS} 341 in mediump vec2 var; 342 void main() 343 { 344 ${FRAG_COLOR} = var.xyyx; 345 } 346 "" 347 end 348 349 # mismatched type, varyings used 350 case type_mismatch_3 351 version 300 es 352 desc "varying type mismatch (int vs. uint)" 353 expect link_fail 354 vertex "" 355 #version 300 es 356 ${VERTEX_DECLARATIONS} 357 flat out mediump int var; 358 void main() 359 { 360 var = 2; 361 ${VERTEX_OUTPUT} 362 } 363 "" 364 fragment "" 365 #version 300 es 366 ${FRAGMENT_DECLARATIONS} 367 flat in mediump uint var; 368 void main() 369 { 370 ${FRAG_COLOR} = vec4(var); 371 } 372 "" 373 end 374 375 # mismatched type, varyings used 376 case struct_type_mismatch_1 377 version 300 es 378 desc "struct member mismatch" 379 expect link_fail 380 vertex "" 381 #version 300 es 382 ${VERTEX_DECLARATIONS} 383 struct S { highp float a; highp vec2 b; }; 384 out S var; 385 void main() 386 { 387 var.a = 2.0; 388 var.b = vec2(1.0, 0.0); 389 ${VERTEX_OUTPUT} 390 } 391 "" 392 fragment "" 393 #version 300 es 394 ${FRAGMENT_DECLARATIONS} 395 struct S { highp float a; highp vec3 b; }; 396 in S var; 397 void main() 398 { 399 ${FRAG_COLOR} = vec4(var.a, var.b); 400 } 401 "" 402 end 403 404 # mismatched type, varyings unused in fragment shader (runtime) 405 case struct_type_mismatch_2 406 version 300 es 407 desc "struct member mismatch" 408 expect link_fail 409 vertex "" 410 #version 300 es 411 ${VERTEX_DECLARATIONS} 412 struct S { highp float a; highp vec2 b; }; 413 out S var; 414 void main() 415 { 416 var.a = 2.0; 417 var.b = vec2(1.0, 0.0); 418 ${VERTEX_OUTPUT} 419 } 420 "" 421 fragment "" 422 #version 300 es 423 ${FRAGMENT_DECLARATIONS} 424 struct S { highp float a; highp vec3 b; }; 425 in S var; 426 void main() 427 { 428 ${FRAG_COLOR} = vec4(var.a); 429 if (false) 430 ${FRAG_COLOR}.yzw = var.b; 431 } 432 "" 433 end 434 435 # mismatched type, varyings unused in both (runtime) 436 case struct_type_mismatch_3 437 version 300 es 438 desc "struct member mismatch" 439 expect link_fail 440 vertex "" 441 #version 300 es 442 ${VERTEX_DECLARATIONS} 443 struct S { highp float a; highp vec2 b; }; 444 out S var; 445 void main() 446 { 447 var.a = 2.0; 448 if (false) 449 var.b = vec2(1.0, 0.0); 450 ${VERTEX_OUTPUT} 451 } 452 "" 453 fragment "" 454 #version 300 es 455 ${FRAGMENT_DECLARATIONS} 456 struct S { highp float a; highp vec3 b; }; 457 in S var; 458 void main() 459 { 460 ${FRAG_COLOR} = vec4(var.a); 461 if (false) 462 ${FRAG_COLOR}.yzw = var.b; 463 } 464 "" 465 end 466 467 # different interpolation 468 case differing_interpolation_1 469 version 300 es 470 desc "varying interpolation different (flat vs. smooth)" 471 values 472 { 473 input float in0 = [ -1.25 | -25.0 | 1.0 | 2.25 | 3.4 | 16.0 ]; 474 output float out0 = [ -1.25 | -25.0 | 1.0 | 2.25 | 3.4 | 16.0 ]; 475 } 476 477 vertex "" 478 #version 300 es 479 ${VERTEX_DECLARATIONS} 480 flat out mediump float var; 481 void main() 482 { 483 var = in0; 484 ${VERTEX_OUTPUT} 485 } 486 "" 487 fragment "" 488 #version 300 es 489 precision mediump float; 490 ${FRAGMENT_DECLARATIONS} 491 in mediump float var; 492 void main() 493 { 494 out0 = var; 495 ${FRAGMENT_OUTPUT} 496 } 497 "" 498 end 499 500 # different interpolation 501 case differing_interpolation_2 502 version 300 es 503 desc "varying interpolation different (smooth vs. centroid)" 504 values 505 { 506 input float in0 = [ -1.25 | -25.0 | 1.0 | 2.25 | 3.4 | 16.0 ]; 507 output float out0 = [ -1.25 | -25.0 | 1.0 | 2.25 | 3.4 | 16.0 ]; 508 } 509 510 vertex "" 511 #version 300 es 512 ${VERTEX_DECLARATIONS} 513 smooth out mediump float var; 514 void main() 515 { 516 var = in0; 517 ${VERTEX_OUTPUT} 518 } 519 "" 520 fragment "" 521 #version 300 es 522 precision mediump float; 523 ${FRAGMENT_DECLARATIONS} 524 centroid in mediump float var; 525 void main() 526 { 527 out0 = var; 528 ${FRAGMENT_OUTPUT} 529 } 530 "" 531 end 532 533 # no declaration in vertex shader, but static use in fragment 534 case illegal_usage_1 535 version 300 es 536 desc "varying not declared in vertex shader, but statically used in fragment shader" 537 expect link_fail 538 vertex "" 539 #version 300 es 540 ${VERTEX_DECLARATIONS} 541 void main() 542 { 543 ${VERTEX_OUTPUT} 544 } 545 "" 546 fragment "" 547 #version 300 es 548 ${FRAGMENT_DECLARATIONS} 549 in mediump float var; 550 void main() 551 { 552 ${FRAG_COLOR} = vec4(var); 553 } 554 "" 555 end 556 557 # non-flat integer varyings not allowed 558 case invalid_type_int 559 version 300 es 560 desc "integer varying used" 561 expect compile_fail 562 vertex "" 563 #version 300 es 564 ${VERTEX_DECLARATIONS} 565 out mediump int var; 566 void main() 567 { 568 ${VERTEX_OUTPUT} 569 } 570 "" 571 fragment "" 572 #version 300 es 573 ${FRAGMENT_DECLARATIONS} 574 in mediump int var; 575 void main() 576 { 577 ${FRAG_COLOR} = vec4(1.0); 578 } 579 "" 580 end 581 582 # non-flat integer varyings not allowed 583 case invalid_type_uint 584 version 300 es 585 desc "integer varying used" 586 expect compile_fail 587 vertex "" 588 #version 300 es 589 ${VERTEX_DECLARATIONS} 590 out mediump uint var; 591 void main() 592 { 593 ${VERTEX_OUTPUT} 594 } 595 "" 596 fragment "" 597 #version 300 es 598 ${FRAGMENT_DECLARATIONS} 599 in mediump uint var; 600 void main() 601 { 602 ${FRAG_COLOR} = vec4(1.0); 603 } 604 "" 605 end 606 607 # bool varyings not allowed 608 case invalid_type_bool 609 version 300 es 610 desc "boolean varying used" 611 expect compile_fail 612 vertex "" 613 #version 300 es 614 ${VERTEX_DECLARATIONS} 615 out bool var; 616 void main() 617 { 618 ${VERTEX_OUTPUT} 619 } 620 "" 621 fragment "" 622 #version 300 es 623 ${FRAGMENT_DECLARATIONS} 624 in bool var; 625 void main() 626 { 627 ${FRAG_COLOR} = vec4(1.0); 628 } 629 "" 630 end 631 632 case invalid_type_struct_array 633 version 300 es 634 desc "float array inside struct" 635 expect compile_fail 636 vertex "" 637 #version 300 es 638 ${VERTEX_DECLARATIONS} 639 struct S { mediump float a[3]; }; 640 out S var; 641 void main() 642 { 643 var.a[0] = 1.0; 644 var.a[1] = 1.0; 645 var.a[2] = 1.0; 646 ${VERTEX_OUTPUT} 647 } 648 "" 649 fragment "" 650 #version 300 es 651 precision mediump float; 652 ${FRAGMENT_DECLARATIONS} 653 struct S { mediump float a[3]; }; 654 in S var; 655 void main() 656 { 657 ${FRAG_COLOR} = vec4(1.0); 658 } 659 "" 660 end 661 662 case invalid_type_struct_struct 663 version 300 es 664 desc "struct inside struct" 665 expect compile_fail 666 vertex "" 667 #version 300 es 668 ${VERTEX_DECLARATIONS} 669 struct S { mediump float a; }; 670 struct T { S s; }; 671 out T var; 672 void main() 673 { 674 var.s.a = 1.0; 675 ${VERTEX_OUTPUT} 676 } 677 "" 678 fragment "" 679 #version 300 es 680 precision mediump float; 681 ${FRAGMENT_DECLARATIONS} 682 struct S { mediump float a; }; 683 struct T { S s; }; 684 in T var; 685 void main() 686 { 687 ${FRAG_COLOR} = vec4(1.0); 688 } 689 "" 690 end 691 692 case invalid_type_array_struct 693 version 300 es 694 desc "array of structs" 695 expect compile_fail 696 vertex "" 697 #version 300 es 698 ${VERTEX_DECLARATIONS} 699 struct S { mediump int a; }; 700 flat out S var[2]; 701 void main() 702 { 703 ${VERTEX_SETUP} 704 var[0].a = 1; 705 var[1].a = 1; 706 ${VERTEX_OUTPUT} 707 } 708 "" 709 fragment "" 710 #version 300 es 711 ${FRAGMENT_DECLARATIONS} 712 struct S { mediump int a; }; 713 flat in S var[2]; 714 void main() 715 { 716 ${FRAG_COLOR} = vec4(1.0); 717 } 718 "" 719 end 720 721 case invalid_type_array_array 722 version 300 es 723 desc "array of arrays" 724 expect compile_fail 725 vertex "" 726 #version 300 es 727 ${VERTEX_DECLARATIONS} 728 out mediump float var[2][2]; 729 void main() 730 { 731 ${VERTEX_SETUP} 732 var[0][0] = 1.0; 733 ${VERTEX_OUTPUT} 734 } 735 "" 736 fragment "" 737 #version 300 es 738 ${FRAGMENT_DECLARATIONS} 739 in mediump float var[2][2]; 740 void main() 741 { 742 ${FRAG_COLOR} = vec4(1.0); 743 } 744 "" 745 end 746 end 747 748 group basic_types "Basic varying types" 749 case float 750 version 300 es 751 desc "varying of type float" 752 values 753 { 754 input float in0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ]; 755 output float out0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ]; 756 } 757 vertex "" 758 #version 300 es 759 ${VERTEX_DECLARATIONS} 760 out mediump float var; 761 void main() 762 { 763 var = in0; 764 ${VERTEX_OUTPUT} 765 } 766 "" 767 fragment "" 768 #version 300 es 769 precision mediump float; 770 ${FRAGMENT_DECLARATIONS} 771 in float var; 772 void main() 773 { 774 out0 = var; 775 ${FRAGMENT_OUTPUT} 776 } 777 "" 778 end 779 780 case vec2 781 version 300 es 782 desc "varying of type vec2" 783 values 784 { 785 input vec2 in0 = [ vec2(-1.25, 1.25) | vec2(-25.65, -7.25) | vec2(0.0, 1.0) | vec2(2.25, 2.25) | vec2(3.4, 9.5) | vec2(16.0, 32.0) ]; 786 output vec2 out0 = [ vec2(-1.25, 1.25) | vec2(-25.65, -7.25) | vec2(0.0, 1.0) | vec2(2.25, 2.25) | vec2(3.4, 9.5) | vec2(16.0, 32.0) ]; 787 } 788 vertex "" 789 #version 300 es 790 ${VERTEX_DECLARATIONS} 791 out mediump vec2 var; 792 void main() 793 { 794 var = in0; 795 ${VERTEX_OUTPUT} 796 } 797 "" 798 fragment "" 799 #version 300 es 800 precision mediump float; 801 ${FRAGMENT_DECLARATIONS} 802 in vec2 var; 803 void main() 804 { 805 out0 = var; 806 ${FRAGMENT_OUTPUT} 807 } 808 "" 809 end 810 811 case vec3 812 version 300 es 813 desc "varying of type vec3" 814 values 815 { 816 input vec3 in0 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ]; 817 output vec3 out0 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ]; 818 } 819 vertex "" 820 #version 300 es 821 ${VERTEX_DECLARATIONS} 822 out mediump vec3 var; 823 void main() 824 { 825 var = in0; 826 ${VERTEX_OUTPUT} 827 } 828 "" 829 fragment "" 830 #version 300 es 831 precision mediump float; 832 ${FRAGMENT_DECLARATIONS} 833 in vec3 var; 834 void main() 835 { 836 out0 = var; 837 ${FRAGMENT_OUTPUT} 838 } 839 "" 840 end 841 842 case vec4 843 version 300 es 844 desc "varying of type vec4" 845 values 846 { 847 input vec4 in0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ]; 848 output vec4 out0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ]; 849 } 850 vertex "" 851 #version 300 es 852 ${VERTEX_DECLARATIONS} 853 out mediump vec4 var; 854 void main() 855 { 856 var = in0; 857 ${VERTEX_OUTPUT} 858 } 859 "" 860 fragment "" 861 #version 300 es 862 precision mediump float; 863 ${FRAGMENT_DECLARATIONS} 864 in vec4 var; 865 void main() 866 { 867 out0 = var; 868 ${FRAGMENT_OUTPUT} 869 } 870 "" 871 end 872 873 case mat2 874 version 300 es 875 desc "varying of type mat2" 876 values 877 { 878 input mat2 in0 = [ mat2(1.0, 1.0, 1.0, 1.0) | mat2(-1.25, 1.25, -9.5, -12.2) | mat2(-25.65, -7.25, 14.21, -77.7) | mat2(0.0, 1.0, -1.0, 2.0) | mat2(2.25, 2.25, 22.5, 225.0) | mat2(3.4, 9.5, 19.5, 29.5) | mat2(16.0, 32.0, -64.0, -128.0) ]; 879 output mat2 out0 = [ mat2(1.0, 1.0, 1.0, 1.0) | mat2(-1.25, 1.25, -9.5, -12.2) | mat2(-25.65, -7.25, 14.21, -77.7) | mat2(0.0, 1.0, -1.0, 2.0) | mat2(2.25, 2.25, 22.5, 225.0) | mat2(3.4, 9.5, 19.5, 29.5) | mat2(16.0, 32.0, -64.0, -128.0) ]; 880 } 881 vertex "" 882 #version 300 es 883 ${VERTEX_DECLARATIONS} 884 out mediump mat2 var; 885 void main() 886 { 887 var = in0; 888 ${VERTEX_OUTPUT} 889 } 890 "" 891 fragment "" 892 #version 300 es 893 precision mediump float; 894 ${FRAGMENT_DECLARATIONS} 895 in mat2 var; 896 void main() 897 { 898 out0 = var; 899 ${FRAGMENT_OUTPUT} 900 } 901 "" 902 end 903 904 case mat2x3 905 version 300 es 906 desc "varying of type mat2x3" 907 values 908 { 909 input mat2x3 in0 = [ mat2x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ]; 910 output mat2x3 out0 = [ mat2x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ]; 911 } 912 vertex "" 913 #version 300 es 914 ${VERTEX_DECLARATIONS} 915 out mediump mat2x3 var; 916 void main() 917 { 918 var = in0; 919 ${VERTEX_OUTPUT} 920 } 921 "" 922 fragment "" 923 #version 300 es 924 precision mediump float; 925 ${FRAGMENT_DECLARATIONS} 926 in mat2x3 var; 927 void main() 928 { 929 out0 = var; 930 ${FRAGMENT_OUTPUT} 931 } 932 "" 933 end 934 935 case mat2x4 936 version 300 es 937 desc "varying of type mat2x4" 938 values 939 { 940 input mat2x4 in0 = [ mat2x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ]; 941 output mat2x4 out0 = [ mat2x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ]; 942 } 943 vertex "" 944 #version 300 es 945 ${VERTEX_DECLARATIONS} 946 out mediump mat2x4 var; 947 void main() 948 { 949 var = in0; 950 ${VERTEX_OUTPUT} 951 } 952 "" 953 fragment "" 954 #version 300 es 955 precision mediump float; 956 ${FRAGMENT_DECLARATIONS} 957 in mat2x4 var; 958 void main() 959 { 960 out0 = var; 961 ${FRAGMENT_OUTPUT} 962 } 963 "" 964 end 965 966 case mat3x2 967 version 300 es 968 desc "varying of type mat3x2" 969 values 970 { 971 input mat3x2 in0 = [ mat3x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ]; 972 output mat3x2 out0 = [ mat3x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ]; 973 } 974 vertex "" 975 #version 300 es 976 ${VERTEX_DECLARATIONS} 977 out mediump mat3x2 var; 978 void main() 979 { 980 var = in0; 981 ${VERTEX_OUTPUT} 982 } 983 "" 984 fragment "" 985 #version 300 es 986 precision mediump float; 987 ${FRAGMENT_DECLARATIONS} 988 in mat3x2 var; 989 void main() 990 { 991 out0 = var; 992 ${FRAGMENT_OUTPUT} 993 } 994 "" 995 end 996 997 case mat3 998 version 300 es 999 desc "varying of type mat3" 1000 values 1001 { 1002 input mat3 in0 = [ mat3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 9.9) | mat3(0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0, -9.9) | mat3(3.4, 9.5, 19.5, 29.5, 16.0, 32.0, -64.0, -128.0, 256.0) ]; 1003 output mat3 out0 = [ mat3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 9.9) | mat3(0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0, -9.9) | mat3(3.4, 9.5, 19.5, 29.5, 16.0, 32.0, -64.0, -128.0, 256.0) ]; 1004 } 1005 vertex "" 1006 #version 300 es 1007 ${VERTEX_DECLARATIONS} 1008 out mediump mat3 var; 1009 void main() 1010 { 1011 var = in0; 1012 ${VERTEX_OUTPUT} 1013 } 1014 "" 1015 fragment "" 1016 #version 300 es 1017 precision mediump float; 1018 ${FRAGMENT_DECLARATIONS} 1019 in mat3 var; 1020 void main() 1021 { 1022 out0 = var; 1023 ${FRAGMENT_OUTPUT} 1024 } 1025 "" 1026 end 1027 1028 case mat3x4 1029 version 300 es 1030 desc "varying of type mat3x4" 1031 values 1032 { 1033 input mat3x4 in0 = [ mat3x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ]; 1034 output mat3x4 out0 = [ mat3x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ]; 1035 } 1036 vertex "" 1037 #version 300 es 1038 ${VERTEX_DECLARATIONS} 1039 out mediump mat3x4 var; 1040 void main() 1041 { 1042 var = in0; 1043 ${VERTEX_OUTPUT} 1044 } 1045 "" 1046 fragment "" 1047 #version 300 es 1048 precision mediump float; 1049 ${FRAGMENT_DECLARATIONS} 1050 in mat3x4 var; 1051 void main() 1052 { 1053 out0 = var; 1054 ${FRAGMENT_OUTPUT} 1055 } 1056 "" 1057 end 1058 1059 case mat4x2 1060 version 300 es 1061 desc "varying of type mat4x2" 1062 values 1063 { 1064 input mat4x2 in0 = [ mat4x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ]; 1065 output mat4x2 out0 = [ mat4x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ]; 1066 } 1067 vertex "" 1068 #version 300 es 1069 ${VERTEX_DECLARATIONS} 1070 out mediump mat4x2 var; 1071 void main() 1072 { 1073 var = in0; 1074 ${VERTEX_OUTPUT} 1075 } 1076 "" 1077 fragment "" 1078 #version 300 es 1079 precision mediump float; 1080 ${FRAGMENT_DECLARATIONS} 1081 in mat4x2 var; 1082 void main() 1083 { 1084 out0 = var; 1085 ${FRAGMENT_OUTPUT} 1086 } 1087 "" 1088 end 1089 1090 case mat4x3 1091 version 300 es 1092 desc "varying of type mat4x3" 1093 values 1094 { 1095 input mat4x3 in0 = [ mat4x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ]; 1096 output mat4x3 out0 = [ mat4x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ]; 1097 } 1098 vertex "" 1099 #version 300 es 1100 ${VERTEX_DECLARATIONS} 1101 out mediump mat4x3 var; 1102 void main() 1103 { 1104 var = in0; 1105 ${VERTEX_OUTPUT} 1106 } 1107 "" 1108 fragment "" 1109 #version 300 es 1110 precision mediump float; 1111 ${FRAGMENT_DECLARATIONS} 1112 in mat4x3 var; 1113 void main() 1114 { 1115 out0 = var; 1116 ${FRAGMENT_OUTPUT} 1117 } 1118 "" 1119 end 1120 1121 case mat4 1122 version 300 es 1123 desc "varying of type mat4" 1124 values 1125 { 1126 input mat4 in0 = [ mat4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0) ]; 1127 output mat4 out0 = [ mat4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0) ]; 1128 } 1129 vertex "" 1130 #version 300 es 1131 ${VERTEX_DECLARATIONS} 1132 out mediump mat4 var; 1133 void main() 1134 { 1135 var = in0; 1136 ${VERTEX_OUTPUT} 1137 } 1138 "" 1139 fragment "" 1140 #version 300 es 1141 precision mediump float; 1142 ${FRAGMENT_DECLARATIONS} 1143 in mat4 var; 1144 void main() 1145 { 1146 out0 = var; 1147 ${FRAGMENT_OUTPUT} 1148 } 1149 "" 1150 end 1151 1152 case int 1153 version 300 es 1154 desc "varying of type int" 1155 values 1156 { 1157 input int in0 = [ -1 | -25 | 1 | 2 | 3 | 16 ]; 1158 output int out0 = [ -1 | -25 | 1 | 2 | 3 | 16 ]; 1159 } 1160 vertex "" 1161 #version 300 es 1162 ${VERTEX_DECLARATIONS} 1163 flat out mediump int var; 1164 void main() 1165 { 1166 ${VERTEX_SETUP} 1167 var = in0; 1168 ${VERTEX_OUTPUT} 1169 } 1170 "" 1171 fragment "" 1172 #version 300 es 1173 ${FRAGMENT_DECLARATIONS} 1174 flat in int var; 1175 void main() 1176 { 1177 out0 = var; 1178 ${FRAGMENT_OUTPUT} 1179 } 1180 "" 1181 end 1182 1183 case ivec2 1184 version 300 es 1185 desc "varying of type ivec2" 1186 values 1187 { 1188 input ivec2 in0 = [ ivec2(-1, 1) | ivec2(-25, 25) | ivec2(1, 1) | ivec2(2, 3) | ivec2(16, 17) ]; 1189 output ivec2 out0 = [ ivec2(-1, 1) | ivec2(-25, 25) | ivec2(1, 1) | ivec2(2, 3) | ivec2(16, 17) ]; 1190 } 1191 vertex "" 1192 #version 300 es 1193 ${VERTEX_DECLARATIONS} 1194 flat out mediump ivec2 var; 1195 void main() 1196 { 1197 ${VERTEX_SETUP} 1198 var = in0; 1199 ${VERTEX_OUTPUT} 1200 } 1201 "" 1202 fragment "" 1203 #version 300 es 1204 ${FRAGMENT_DECLARATIONS} 1205 flat in ivec2 var; 1206 void main() 1207 { 1208 out0 = var; 1209 ${FRAGMENT_OUTPUT} 1210 } 1211 "" 1212 end 1213 1214 case ivec3 1215 version 300 es 1216 desc "varying of type ivec3" 1217 values 1218 { 1219 input ivec3 in0 = [ ivec3(-1, 1, -2) | ivec3(-25, 25, -3) | ivec3(1, 1, 1) | ivec3(2, 3, 4) | ivec3(16, 17, 18) ]; 1220 output ivec3 out0 = [ ivec3(-1, 1, -2) | ivec3(-25, 25, -3) | ivec3(1, 1, 1) | ivec3(2, 3, 4) | ivec3(16, 17, 18) ]; 1221 } 1222 vertex "" 1223 #version 300 es 1224 ${VERTEX_DECLARATIONS} 1225 flat out mediump ivec3 var; 1226 void main() 1227 { 1228 ${VERTEX_SETUP} 1229 var = in0; 1230 ${VERTEX_OUTPUT} 1231 } 1232 "" 1233 fragment "" 1234 #version 300 es 1235 ${FRAGMENT_DECLARATIONS} 1236 flat in ivec3 var; 1237 void main() 1238 { 1239 out0 = var; 1240 ${FRAGMENT_OUTPUT} 1241 } 1242 "" 1243 end 1244 1245 case ivec4 1246 version 300 es 1247 desc "varying of type ivec4" 1248 values 1249 { 1250 input ivec4 in0 = [ ivec4(-1, 1, -2, 2) | ivec4(-25, 25, -3, 3) | ivec4(1, 1, 1, 1) | ivec4(2, 3, 4, 5) | ivec4(16, 17, 18, 19) ]; 1251 output ivec4 out0 = [ ivec4(-1, 1, -2, 2) | ivec4(-25, 25, -3, 3) | ivec4(1, 1, 1, 1) | ivec4(2, 3, 4, 5) | ivec4(16, 17, 18, 19) ]; 1252 } 1253 vertex "" 1254 #version 300 es 1255 ${VERTEX_DECLARATIONS} 1256 flat out mediump ivec4 var; 1257 void main() 1258 { 1259 ${VERTEX_SETUP} 1260 var = in0; 1261 ${VERTEX_OUTPUT} 1262 } 1263 "" 1264 fragment "" 1265 #version 300 es 1266 ${FRAGMENT_DECLARATIONS} 1267 flat in ivec4 var; 1268 void main() 1269 { 1270 out0 = var; 1271 ${FRAGMENT_OUTPUT} 1272 } 1273 "" 1274 end 1275 1276 case uint 1277 version 300 es 1278 desc "varying of type int" 1279 values 1280 { 1281 input uint in0 = [ 1 | 2 | 3 | 16 ]; 1282 output uint out0 = [ 1 | 2 | 3 | 16 ]; 1283 } 1284 vertex "" 1285 #version 300 es 1286 ${VERTEX_DECLARATIONS} 1287 flat out mediump uint var; 1288 void main() 1289 { 1290 ${VERTEX_SETUP} 1291 var = in0; 1292 ${VERTEX_OUTPUT} 1293 } 1294 "" 1295 fragment "" 1296 #version 300 es 1297 ${FRAGMENT_DECLARATIONS} 1298 flat in uint var; 1299 void main() 1300 { 1301 out0 = var; 1302 ${FRAGMENT_OUTPUT} 1303 } 1304 "" 1305 end 1306 1307 case uvec2 1308 version 300 es 1309 desc "varying of type uvec2" 1310 values 1311 { 1312 input uvec2 in0 = [ uvec2(1, 1) | uvec2(25, 25) | uvec2(1, 1) | uvec2(2, 3) | uvec2(16, 17) ]; 1313 output uvec2 out0 = [ uvec2(1, 1) | uvec2(25, 25) | uvec2(1, 1) | uvec2(2, 3) | uvec2(16, 17) ]; 1314 } 1315 vertex "" 1316 #version 300 es 1317 ${VERTEX_DECLARATIONS} 1318 flat out mediump uvec2 var; 1319 void main() 1320 { 1321 ${VERTEX_SETUP} 1322 var = in0; 1323 ${VERTEX_OUTPUT} 1324 } 1325 "" 1326 fragment "" 1327 #version 300 es 1328 ${FRAGMENT_DECLARATIONS} 1329 flat in uvec2 var; 1330 void main() 1331 { 1332 out0 = var; 1333 ${FRAGMENT_OUTPUT} 1334 } 1335 "" 1336 end 1337 1338 case uvec3 1339 version 300 es 1340 desc "varying of type uvec3" 1341 values 1342 { 1343 input uvec3 in0 = [ uvec3(1, 1, 2) | uvec3(25, 25, 3) | uvec3(1, 1, 1) | uvec3(2, 3, 4) | uvec3(16, 17, 18) ]; 1344 output uvec3 out0 = [ uvec3(1, 1, 2) | uvec3(25, 25, 3) | uvec3(1, 1, 1) | uvec3(2, 3, 4) | uvec3(16, 17, 18) ]; 1345 } 1346 vertex "" 1347 #version 300 es 1348 ${VERTEX_DECLARATIONS} 1349 flat out mediump uvec3 var; 1350 void main() 1351 { 1352 ${VERTEX_SETUP} 1353 var = in0; 1354 ${VERTEX_OUTPUT} 1355 } 1356 "" 1357 fragment "" 1358 #version 300 es 1359 ${FRAGMENT_DECLARATIONS} 1360 flat in uvec3 var; 1361 void main() 1362 { 1363 out0 = var; 1364 ${FRAGMENT_OUTPUT} 1365 } 1366 "" 1367 end 1368 1369 case uvec4 1370 version 300 es 1371 desc "varying of type uvec4" 1372 values 1373 { 1374 input uvec4 in0 = [ uvec4(1, 1, 2, 2) | uvec4(25, 25, 3, 3) | uvec4(1, 1, 1, 1) | uvec4(2, 3, 4, 5) | uvec4(16, 17, 18, 19) ]; 1375 output uvec4 out0 = [ uvec4(1, 1, 2, 2) | uvec4(25, 25, 3, 3) | uvec4(1, 1, 1, 1) | uvec4(2, 3, 4, 5) | uvec4(16, 17, 18, 19) ]; 1376 } 1377 vertex "" 1378 #version 300 es 1379 ${VERTEX_DECLARATIONS} 1380 flat out mediump uvec4 var; 1381 void main() 1382 { 1383 ${VERTEX_SETUP} 1384 var = in0; 1385 ${VERTEX_OUTPUT} 1386 } 1387 "" 1388 fragment "" 1389 #version 300 es 1390 ${FRAGMENT_DECLARATIONS} 1391 flat in uvec4 var; 1392 void main() 1393 { 1394 out0 = var; 1395 ${FRAGMENT_OUTPUT} 1396 } 1397 "" 1398 end 1399 end 1400 1401 group struct "Structure varyings" 1402 case float 1403 version 300 es 1404 desc "varying of type float inside struct" 1405 values 1406 { 1407 input float in0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ]; 1408 output float out0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ]; 1409 } 1410 vertex "" 1411 #version 300 es 1412 ${VERTEX_DECLARATIONS} 1413 struct S { mediump float a; }; 1414 out S var; 1415 void main() 1416 { 1417 var.a = in0; 1418 ${VERTEX_OUTPUT} 1419 } 1420 "" 1421 fragment "" 1422 #version 300 es 1423 precision mediump float; 1424 ${FRAGMENT_DECLARATIONS} 1425 struct S { mediump float a; }; 1426 in S var; 1427 void main() 1428 { 1429 out0 = var.a; 1430 ${FRAGMENT_OUTPUT} 1431 } 1432 "" 1433 end 1434 1435 case vec2 1436 version 300 es 1437 desc "varying of type vec2 inside struct" 1438 values 1439 { 1440 input vec2 in0 = [ vec2(-1.25, 1.25) | vec2(-25.65, -7.25) | vec2(0.0, 1.0) | vec2(2.25, 2.25) | vec2(3.4, 9.5) | vec2(16.0, 32.0) ]; 1441 output vec2 out0 = [ vec2(-1.25, 1.25) | vec2(-25.65, -7.25) | vec2(0.0, 1.0) | vec2(2.25, 2.25) | vec2(3.4, 9.5) | vec2(16.0, 32.0) ]; 1442 } 1443 vertex "" 1444 #version 300 es 1445 ${VERTEX_DECLARATIONS} 1446 struct S { mediump vec2 a; }; 1447 out S var; 1448 void main() 1449 { 1450 var.a = in0; 1451 ${VERTEX_OUTPUT} 1452 } 1453 "" 1454 fragment "" 1455 #version 300 es 1456 precision mediump float; 1457 ${FRAGMENT_DECLARATIONS} 1458 struct S { mediump vec2 a; }; 1459 in S var; 1460 void main() 1461 { 1462 out0 = var.a; 1463 ${FRAGMENT_OUTPUT} 1464 } 1465 "" 1466 end 1467 1468 case vec3 1469 version 300 es 1470 desc "varying of type vec3 inside struct" 1471 values 1472 { 1473 input vec3 in0 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ]; 1474 output vec3 out0 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ]; 1475 } 1476 vertex "" 1477 #version 300 es 1478 ${VERTEX_DECLARATIONS} 1479 struct S { mediump vec3 a; }; 1480 out S var; 1481 void main() 1482 { 1483 var.a = in0; 1484 ${VERTEX_OUTPUT} 1485 } 1486 "" 1487 fragment "" 1488 #version 300 es 1489 precision mediump float; 1490 ${FRAGMENT_DECLARATIONS} 1491 struct S { mediump vec3 a; }; 1492 in S var; 1493 void main() 1494 { 1495 out0 = var.a; 1496 ${FRAGMENT_OUTPUT} 1497 } 1498 "" 1499 end 1500 1501 case vec4 1502 version 300 es 1503 desc "varying of type vec4 inside struct" 1504 values 1505 { 1506 input vec4 in0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ]; 1507 output vec4 out0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ]; 1508 } 1509 vertex "" 1510 #version 300 es 1511 ${VERTEX_DECLARATIONS} 1512 struct S { mediump vec4 a; }; 1513 out S var; 1514 void main() 1515 { 1516 var.a = in0; 1517 ${VERTEX_OUTPUT} 1518 } 1519 "" 1520 fragment "" 1521 #version 300 es 1522 precision mediump float; 1523 ${FRAGMENT_DECLARATIONS} 1524 struct S { mediump vec4 a; }; 1525 in S var; 1526 void main() 1527 { 1528 out0 = var.a; 1529 ${FRAGMENT_OUTPUT} 1530 } 1531 "" 1532 end 1533 1534 case mat2 1535 version 300 es 1536 desc "varying of type mat2 inside struct" 1537 values 1538 { 1539 input mat2 in0 = [ mat2(1.0, 1.0, 1.0, 1.0) | mat2(-1.25, 1.25, -9.5, -12.2) | mat2(-25.65, -7.25, 14.21, -77.7) | mat2(0.0, 1.0, -1.0, 2.0) | mat2(2.25, 2.25, 22.5, 225.0) | mat2(3.4, 9.5, 19.5, 29.5) | mat2(16.0, 32.0, -64.0, -128.0) ]; 1540 output mat2 out0 = [ mat2(1.0, 1.0, 1.0, 1.0) | mat2(-1.25, 1.25, -9.5, -12.2) | mat2(-25.65, -7.25, 14.21, -77.7) | mat2(0.0, 1.0, -1.0, 2.0) | mat2(2.25, 2.25, 22.5, 225.0) | mat2(3.4, 9.5, 19.5, 29.5) | mat2(16.0, 32.0, -64.0, -128.0) ]; 1541 } 1542 vertex "" 1543 #version 300 es 1544 ${VERTEX_DECLARATIONS} 1545 struct S { mediump mat2 a; }; 1546 out S var; 1547 void main() 1548 { 1549 var.a = in0; 1550 ${VERTEX_OUTPUT} 1551 } 1552 "" 1553 fragment "" 1554 #version 300 es 1555 precision mediump float; 1556 ${FRAGMENT_DECLARATIONS} 1557 struct S { mediump mat2 a; }; 1558 in S var; 1559 void main() 1560 { 1561 out0 = var.a; 1562 ${FRAGMENT_OUTPUT} 1563 } 1564 "" 1565 end 1566 1567 case mat2x3 1568 version 300 es 1569 desc "varying of type mat2x3 inside struct" 1570 values 1571 { 1572 input mat2x3 in0 = [ mat2x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ]; 1573 output mat2x3 out0 = [ mat2x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ]; 1574 } 1575 vertex "" 1576 #version 300 es 1577 ${VERTEX_DECLARATIONS} 1578 struct S { mediump mat2x3 a; }; 1579 out S var; 1580 void main() 1581 { 1582 var.a = in0; 1583 ${VERTEX_OUTPUT} 1584 } 1585 "" 1586 fragment "" 1587 #version 300 es 1588 precision mediump float; 1589 ${FRAGMENT_DECLARATIONS} 1590 struct S { mediump mat2x3 a; }; 1591 in S var; 1592 void main() 1593 { 1594 out0 = var.a; 1595 ${FRAGMENT_OUTPUT} 1596 } 1597 "" 1598 end 1599 1600 case mat2x4 1601 version 300 es 1602 desc "varying of type mat2x4 inside struct" 1603 values 1604 { 1605 input mat2x4 in0 = [ mat2x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ]; 1606 output mat2x4 out0 = [ mat2x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ]; 1607 } 1608 vertex "" 1609 #version 300 es 1610 ${VERTEX_DECLARATIONS} 1611 struct S { mediump mat2x4 a; }; 1612 out S var; 1613 void main() 1614 { 1615 var.a = in0; 1616 ${VERTEX_OUTPUT} 1617 } 1618 "" 1619 fragment "" 1620 #version 300 es 1621 precision mediump float; 1622 ${FRAGMENT_DECLARATIONS} 1623 struct S { mediump mat2x4 a; }; 1624 in S var; 1625 void main() 1626 { 1627 out0 = var.a; 1628 ${FRAGMENT_OUTPUT} 1629 } 1630 "" 1631 end 1632 1633 case mat3x2 1634 version 300 es 1635 desc "varying of type mat3x2 inside struct" 1636 values 1637 { 1638 input mat3x2 in0 = [ mat3x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ]; 1639 output mat3x2 out0 = [ mat3x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25) ]; 1640 } 1641 vertex "" 1642 #version 300 es 1643 ${VERTEX_DECLARATIONS} 1644 struct S { mediump mat3x2 a; }; 1645 out S var; 1646 void main() 1647 { 1648 var.a = in0; 1649 ${VERTEX_OUTPUT} 1650 } 1651 "" 1652 fragment "" 1653 #version 300 es 1654 precision mediump float; 1655 ${FRAGMENT_DECLARATIONS} 1656 struct S { mediump mat3x2 a; }; 1657 in S var; 1658 void main() 1659 { 1660 out0 = var.a; 1661 ${FRAGMENT_OUTPUT} 1662 } 1663 "" 1664 end 1665 1666 case mat3 1667 version 300 es 1668 desc "varying of type mat3 inside struct" 1669 values 1670 { 1671 input mat3 in0 = [ mat3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 9.9) | mat3(0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0, -9.9) | mat3(3.4, 9.5, 19.5, 29.5, 16.0, 32.0, -64.0, -128.0, 256.0) ]; 1672 output mat3 out0 = [ mat3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 9.9) | mat3(0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0, -9.9) | mat3(3.4, 9.5, 19.5, 29.5, 16.0, 32.0, -64.0, -128.0, 256.0) ]; 1673 } 1674 vertex "" 1675 #version 300 es 1676 ${VERTEX_DECLARATIONS} 1677 struct S { mediump mat3 a; }; 1678 out S var; 1679 void main() 1680 { 1681 var.a = in0; 1682 ${VERTEX_OUTPUT} 1683 } 1684 "" 1685 fragment "" 1686 #version 300 es 1687 precision mediump float; 1688 ${FRAGMENT_DECLARATIONS} 1689 struct S { mediump mat3 a; }; 1690 in S var; 1691 void main() 1692 { 1693 out0 = var.a; 1694 ${FRAGMENT_OUTPUT} 1695 } 1696 "" 1697 end 1698 1699 case mat3x4 1700 version 300 es 1701 desc "varying of type mat3x4 inside struct" 1702 values 1703 { 1704 input mat3x4 in0 = [ mat3x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ]; 1705 output mat3x4 out0 = [ mat3x4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ]; 1706 } 1707 vertex "" 1708 #version 300 es 1709 ${VERTEX_DECLARATIONS} 1710 struct S { mediump mat3x4 a; }; 1711 out S var; 1712 void main() 1713 { 1714 var.a = in0; 1715 ${VERTEX_OUTPUT} 1716 } 1717 "" 1718 fragment "" 1719 #version 300 es 1720 precision mediump float; 1721 ${FRAGMENT_DECLARATIONS} 1722 struct S { mediump mat3x4 a; }; 1723 in S var; 1724 void main() 1725 { 1726 out0 = var.a; 1727 ${FRAGMENT_OUTPUT} 1728 } 1729 "" 1730 end 1731 1732 case mat4x2 1733 version 300 es 1734 desc "varying of type mat4x2 inside struct" 1735 values 1736 { 1737 input mat4x2 in0 = [ mat4x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ]; 1738 output mat4x2 out0 = [ mat4x2(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7) ]; 1739 } 1740 vertex "" 1741 #version 300 es 1742 ${VERTEX_DECLARATIONS} 1743 struct S { mediump mat4x2 a; }; 1744 out S var; 1745 void main() 1746 { 1747 var.a = in0; 1748 ${VERTEX_OUTPUT} 1749 } 1750 "" 1751 fragment "" 1752 #version 300 es 1753 precision mediump float; 1754 ${FRAGMENT_DECLARATIONS} 1755 struct S { mediump mat4x2 a; }; 1756 in S var; 1757 void main() 1758 { 1759 out0 = var.a; 1760 ${FRAGMENT_OUTPUT} 1761 } 1762 "" 1763 end 1764 1765 case mat4x3 1766 version 300 es 1767 desc "varying of type mat4x3 inside struct" 1768 values 1769 { 1770 input mat4x3 in0 = [ mat4x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ]; 1771 output mat4x3 out0 = [ mat4x3(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0) ]; 1772 } 1773 vertex "" 1774 #version 300 es 1775 ${VERTEX_DECLARATIONS} 1776 struct S { mediump mat4x3 a; }; 1777 out S var; 1778 void main() 1779 { 1780 var.a = in0; 1781 ${VERTEX_OUTPUT} 1782 } 1783 "" 1784 fragment "" 1785 #version 300 es 1786 precision mediump float; 1787 ${FRAGMENT_DECLARATIONS} 1788 struct S { mediump mat4x3 a; }; 1789 in S var; 1790 void main() 1791 { 1792 out0 = var.a; 1793 ${FRAGMENT_OUTPUT} 1794 } 1795 "" 1796 end 1797 1798 case mat4 1799 version 300 es 1800 desc "varying of type mat4 inside struct" 1801 values 1802 { 1803 input mat4 in0 = [ mat4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0) ]; 1804 output mat4 out0 = [ mat4(-1.25, 1.25, -9.5, -12.2, -25.65, -7.25, 14.21, -77.7, 0.0, 1.0, -1.0, 2.0, 2.25, 2.25, 22.5, 225.0) ]; 1805 } 1806 vertex "" 1807 #version 300 es 1808 ${VERTEX_DECLARATIONS} 1809 struct S { mediump mat4 a; }; 1810 out S var; 1811 void main() 1812 { 1813 var.a = in0; 1814 ${VERTEX_OUTPUT} 1815 } 1816 "" 1817 fragment "" 1818 #version 300 es 1819 precision mediump float; 1820 ${FRAGMENT_DECLARATIONS} 1821 struct S { mediump mat4 a; }; 1822 in S var; 1823 void main() 1824 { 1825 out0 = var.a; 1826 ${FRAGMENT_OUTPUT} 1827 } 1828 "" 1829 end 1830 1831 case int 1832 version 300 es 1833 desc "varying of type int inside struct" 1834 values 1835 { 1836 input int in0 = [ -1 | -25 | 1 | 2 | 3 | 16 ]; 1837 output int out0 = [ -1 | -25 | 1 | 2 | 3 | 16 ]; 1838 } 1839 vertex "" 1840 #version 300 es 1841 ${VERTEX_DECLARATIONS} 1842 struct S { mediump int a; }; 1843 flat out S var; 1844 void main() 1845 { 1846 ${VERTEX_SETUP} 1847 var.a = in0; 1848 ${VERTEX_OUTPUT} 1849 } 1850 "" 1851 fragment "" 1852 #version 300 es 1853 ${FRAGMENT_DECLARATIONS} 1854 struct S { mediump int a; }; 1855 flat in S var; 1856 void main() 1857 { 1858 out0 = var.a; 1859 ${FRAGMENT_OUTPUT} 1860 } 1861 "" 1862 end 1863 1864 case ivec2 1865 version 300 es 1866 desc "varying of type ivec2 inside struct" 1867 values 1868 { 1869 input ivec2 in0 = [ ivec2(-1, 1) | ivec2(-25, 25) | ivec2(1, 1) | ivec2(2, 3) | ivec2(16, 17) ]; 1870 output ivec2 out0 = [ ivec2(-1, 1) | ivec2(-25, 25) | ivec2(1, 1) | ivec2(2, 3) | ivec2(16, 17) ]; 1871 } 1872 vertex "" 1873 #version 300 es 1874 ${VERTEX_DECLARATIONS} 1875 struct S { mediump ivec2 a; }; 1876 flat out S var; 1877 void main() 1878 { 1879 ${VERTEX_SETUP} 1880 var.a = in0; 1881 ${VERTEX_OUTPUT} 1882 } 1883 "" 1884 fragment "" 1885 #version 300 es 1886 ${FRAGMENT_DECLARATIONS} 1887 struct S { mediump ivec2 a; }; 1888 flat in S var; 1889 void main() 1890 { 1891 out0 = var.a; 1892 ${FRAGMENT_OUTPUT} 1893 } 1894 "" 1895 end 1896 1897 case ivec3 1898 version 300 es 1899 desc "varying of type ivec3 inside struct" 1900 values 1901 { 1902 input ivec3 in0 = [ ivec3(-1, 1, -2) | ivec3(-25, 25, -3) | ivec3(1, 1, 1) | ivec3(2, 3, 4) | ivec3(16, 17, 18) ]; 1903 output ivec3 out0 = [ ivec3(-1, 1, -2) | ivec3(-25, 25, -3) | ivec3(1, 1, 1) | ivec3(2, 3, 4) | ivec3(16, 17, 18) ]; 1904 } 1905 vertex "" 1906 #version 300 es 1907 ${VERTEX_DECLARATIONS} 1908 struct S { mediump ivec3 a; }; 1909 flat out S var; 1910 void main() 1911 { 1912 ${VERTEX_SETUP} 1913 var.a = in0; 1914 ${VERTEX_OUTPUT} 1915 } 1916 "" 1917 fragment "" 1918 #version 300 es 1919 ${FRAGMENT_DECLARATIONS} 1920 struct S { mediump ivec3 a; }; 1921 flat in S var; 1922 void main() 1923 { 1924 out0 = var.a; 1925 ${FRAGMENT_OUTPUT} 1926 } 1927 "" 1928 end 1929 1930 case ivec4 1931 version 300 es 1932 desc "varying of type ivec4 inside struct" 1933 values 1934 { 1935 input ivec4 in0 = [ ivec4(-1, 1, -2, 2) | ivec4(-25, 25, -3, 3) | ivec4(1, 1, 1, 1) | ivec4(2, 3, 4, 5) | ivec4(16, 17, 18, 19) ]; 1936 output ivec4 out0 = [ ivec4(-1, 1, -2, 2) | ivec4(-25, 25, -3, 3) | ivec4(1, 1, 1, 1) | ivec4(2, 3, 4, 5) | ivec4(16, 17, 18, 19) ]; 1937 } 1938 vertex "" 1939 #version 300 es 1940 ${VERTEX_DECLARATIONS} 1941 struct S { mediump ivec4 a; }; 1942 flat out S var; 1943 void main() 1944 { 1945 ${VERTEX_SETUP} 1946 var.a = in0; 1947 ${VERTEX_OUTPUT} 1948 } 1949 "" 1950 fragment "" 1951 #version 300 es 1952 ${FRAGMENT_DECLARATIONS} 1953 struct S { mediump ivec4 a; }; 1954 flat in S var; 1955 void main() 1956 { 1957 out0 = var.a; 1958 ${FRAGMENT_OUTPUT} 1959 } 1960 "" 1961 end 1962 1963 case uint 1964 version 300 es 1965 desc "varying of type uint in struct" 1966 values 1967 { 1968 input uint in0 = [ 1 | 2 | 3 | 16 ]; 1969 output uint out0 = [ 1 | 2 | 3 | 16 ]; 1970 } 1971 vertex "" 1972 #version 300 es 1973 ${VERTEX_DECLARATIONS} 1974 struct S { mediump uint a; }; 1975 flat out S var; 1976 void main() 1977 { 1978 ${VERTEX_SETUP} 1979 var.a = in0; 1980 ${VERTEX_OUTPUT} 1981 } 1982 "" 1983 fragment "" 1984 #version 300 es 1985 ${FRAGMENT_DECLARATIONS} 1986 struct S { mediump uint a; }; 1987 flat in S var; 1988 void main() 1989 { 1990 out0 = var.a; 1991 ${FRAGMENT_OUTPUT} 1992 } 1993 "" 1994 end 1995 1996 case uvec2 1997 version 300 es 1998 desc "varying of type uvec2 inside struct" 1999 values 2000 { 2001 input uvec2 in0 = [ uvec2(1, 1) | uvec2(25, 25) | uvec2(1, 1) | uvec2(2, 3) | uvec2(16, 17) ]; 2002 output uvec2 out0 = [ uvec2(1, 1) | uvec2(25, 25) | uvec2(1, 1) | uvec2(2, 3) | uvec2(16, 17) ]; 2003 } 2004 vertex "" 2005 #version 300 es 2006 ${VERTEX_DECLARATIONS} 2007 struct S { mediump uvec2 a; }; 2008 flat out S var; 2009 void main() 2010 { 2011 ${VERTEX_SETUP} 2012 var.a = in0; 2013 ${VERTEX_OUTPUT} 2014 } 2015 "" 2016 fragment "" 2017 #version 300 es 2018 ${FRAGMENT_DECLARATIONS} 2019 struct S { mediump uvec2 a; }; 2020 flat in S var; 2021 void main() 2022 { 2023 out0 = var.a; 2024 ${FRAGMENT_OUTPUT} 2025 } 2026 "" 2027 end 2028 2029 case uvec3 2030 version 300 es 2031 desc "varying of type uvec3 inside struct" 2032 values 2033 { 2034 input uvec3 in0 = [ uvec3(1, 1, 2) | uvec3(25, 25, 3) | uvec3(1, 1, 1) | uvec3(2, 3, 4) | uvec3(16, 17, 18) ]; 2035 output uvec3 out0 = [ uvec3(1, 1, 2) | uvec3(25, 25, 3) | uvec3(1, 1, 1) | uvec3(2, 3, 4) | uvec3(16, 17, 18) ]; 2036 } 2037 vertex "" 2038 #version 300 es 2039 ${VERTEX_DECLARATIONS} 2040 struct S { mediump uvec3 a; }; 2041 flat out S var; 2042 void main() 2043 { 2044 ${VERTEX_SETUP} 2045 var.a = in0; 2046 ${VERTEX_OUTPUT} 2047 } 2048 "" 2049 fragment "" 2050 #version 300 es 2051 ${FRAGMENT_DECLARATIONS} 2052 struct S { mediump uvec3 a; }; 2053 flat in S var; 2054 void main() 2055 { 2056 out0 = var.a; 2057 ${FRAGMENT_OUTPUT} 2058 } 2059 "" 2060 end 2061 2062 case uvec4 2063 version 300 es 2064 desc "varying of type uvec4 inside struct" 2065 values 2066 { 2067 input uvec4 in0 = [ uvec4(1, 1, 2, 2) | uvec4(25, 25, 3, 3) | uvec4(1, 1, 1, 1) | uvec4(2, 3, 4, 5) | uvec4(16, 17, 18, 19) ]; 2068 output uvec4 out0 = [ uvec4(1, 1, 2, 2) | uvec4(25, 25, 3, 3) | uvec4(1, 1, 1, 1) | uvec4(2, 3, 4, 5) | uvec4(16, 17, 18, 19) ]; 2069 } 2070 vertex "" 2071 #version 300 es 2072 ${VERTEX_DECLARATIONS} 2073 struct S { mediump uvec4 a; }; 2074 flat out S var; 2075 void main() 2076 { 2077 ${VERTEX_SETUP} 2078 var.a = in0; 2079 ${VERTEX_OUTPUT} 2080 } 2081 "" 2082 fragment "" 2083 #version 300 es 2084 ${FRAGMENT_DECLARATIONS} 2085 struct S { mediump uvec4 a; }; 2086 flat in S var; 2087 void main() 2088 { 2089 out0 = var.a; 2090 ${FRAGMENT_OUTPUT} 2091 } 2092 "" 2093 end 2094 2095 case float_vec3 2096 version 300 es 2097 desc "varyings of type float and vec3 inside struct" 2098 values 2099 { 2100 input float in0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ]; 2101 output float out0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ]; 2102 input vec3 in1 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ]; 2103 output vec3 out1 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ]; 2104 } 2105 vertex "" 2106 #version 300 es 2107 ${VERTEX_DECLARATIONS} 2108 struct S { mediump float a; highp vec3 b; }; 2109 out S var; 2110 void main() 2111 { 2112 var.a = in0; 2113 var.b = in1; 2114 ${VERTEX_OUTPUT} 2115 } 2116 "" 2117 fragment "" 2118 #version 300 es 2119 precision mediump float; 2120 ${FRAGMENT_DECLARATIONS} 2121 struct S { mediump float a; highp vec3 b; }; 2122 in S var; 2123 void main() 2124 { 2125 out0 = var.a; 2126 out1 = var.b; 2127 ${FRAGMENT_OUTPUT} 2128 } 2129 "" 2130 end 2131 2132 case float_uvec2_vec3 2133 version 300 es 2134 desc "varyings of type float and vec3 inside struct" 2135 values 2136 { 2137 input float in0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ]; 2138 output float out0 = [ -1.25 | -25.65 | 1.0 | 2.25 | 3.4 | 16.0 ]; 2139 input uvec2 in1 = [ uvec2(1, 1) | uvec2(25, 25) | uvec2(1, 1) | uvec2(2, 3) | uvec2(16, 17) | uvec2(8, 7) ]; 2140 output uvec2 out1 = [ uvec2(1, 1) | uvec2(25, 25) | uvec2(1, 1) | uvec2(2, 3) | uvec2(16, 17) | uvec2(8, 7) ]; 2141 input vec3 in2 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ]; 2142 output vec3 out2 = [ vec3(-1.25, 1.25, -9.5) | vec3(-25.65, -7.25, 14.21) | vec3(0.0, 1.0, -1.0) | vec3(2.25, 2.25, 22.5) | vec3(3.4, 9.5, 19.5) | vec3(16.0, 32.0, -64.0) ]; 2143 } 2144 vertex "" 2145 #version 300 es 2146 ${VERTEX_DECLARATIONS} 2147 struct S { mediump float a; highp uvec2 b; highp vec3 c; }; 2148 flat out S var; 2149 void main() 2150 { 2151 ${VERTEX_SETUP} 2152 var.a = in0; 2153 var.b = in1; 2154 var.c = in2; 2155 ${VERTEX_OUTPUT} 2156 } 2157 "" 2158 fragment "" 2159 #version 300 es 2160 precision mediump float; 2161 ${FRAGMENT_DECLARATIONS} 2162 struct S { mediump float a; highp uvec2 b; highp vec3 c; }; 2163 flat in S var; 2164 void main() 2165 { 2166 out0 = var.a; 2167 out1 = var.b; 2168 out2 = var.c; 2169 ${FRAGMENT_OUTPUT} 2170 } 2171 "" 2172 end 2173 end 2174 2175 group interpolation "Varying interpolation modes" 2176 case smooth 2177 version 300 es 2178 desc "varying of type vec4" 2179 values 2180 { 2181 input vec4 in0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ]; 2182 output vec4 out0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ]; 2183 } 2184 vertex "" 2185 #version 300 es 2186 ${VERTEX_DECLARATIONS} 2187 smooth out mediump vec4 var; 2188 void main() 2189 { 2190 var = in0; 2191 ${VERTEX_OUTPUT} 2192 } 2193 "" 2194 fragment "" 2195 #version 300 es 2196 precision mediump float; 2197 ${FRAGMENT_DECLARATIONS} 2198 smooth in vec4 var; 2199 void main() 2200 { 2201 out0 = var; 2202 ${FRAGMENT_OUTPUT} 2203 } 2204 "" 2205 end 2206 2207 case centroid 2208 version 300 es 2209 desc "varying of type vec4" 2210 values 2211 { 2212 input vec4 in0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ]; 2213 output vec4 out0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ]; 2214 } 2215 vertex "" 2216 #version 300 es 2217 ${VERTEX_DECLARATIONS} 2218 centroid out mediump vec4 var; 2219 void main() 2220 { 2221 var = in0; 2222 ${VERTEX_OUTPUT} 2223 } 2224 "" 2225 fragment "" 2226 #version 300 es 2227 precision mediump float; 2228 ${FRAGMENT_DECLARATIONS} 2229 centroid in vec4 var; 2230 void main() 2231 { 2232 out0 = var; 2233 ${FRAGMENT_OUTPUT} 2234 } 2235 "" 2236 end 2237 2238 case flat 2239 version 300 es 2240 desc "varying of type vec4" 2241 values 2242 { 2243 input vec4 in0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ]; 2244 output vec4 out0 = [ vec4(-1.25, 1.25, -9.5, -12.2) | vec4(-25.65, -7.25, 14.21, -77.7) | vec4(0.0, 1.0, -1.0, 2.0) | vec4(2.25, 2.25, 22.5, 225.0) | vec4(3.4, 9.5, 19.5, 29.5) | vec4(16.0, 32.0, -64.0, -128.0) ]; 2245 } 2246 vertex "" 2247 #version 300 es 2248 ${VERTEX_DECLARATIONS} 2249 flat out mediump vec4 var; 2250 void main() 2251 { 2252 var = in0; 2253 ${VERTEX_OUTPUT} 2254 } 2255 "" 2256 fragment "" 2257 #version 300 es 2258 precision mediump float; 2259 ${FRAGMENT_DECLARATIONS} 2260 flat in vec4 var; 2261 void main() 2262 { 2263 out0 = var; 2264 ${FRAGMENT_OUTPUT} 2265 } 2266 "" 2267 end 2268 end 2269 2270 group usage "Varying usage in shaders" 2271 case readback_1 2272 version 300 es 2273 desc "read back (an already written) varying in the vertex shader" 2274 values 2275 { 2276 input float in0 = [ 1.0 | 0.0 | -2.0 | 10.0 ]; 2277 output float out0 = [ 3.0 | 0.0 | -6.0 | 30.0 ]; 2278 } 2279 vertex "" 2280 #version 300 es 2281 precision mediump float; 2282 ${VERTEX_DECLARATIONS} 2283 out float var1; 2284 out float var2; 2285 2286 void main() 2287 { 2288 var1 = in0; 2289 var2 = var1 + in0; 2290 ${VERTEX_OUTPUT} 2291 } 2292 "" 2293 fragment "" 2294 #version 300 es 2295 precision mediump float; 2296 ${FRAGMENT_DECLARATIONS} 2297 in float var1; 2298 in float var2; 2299 2300 void main() 2301 { 2302 out0 = var1 + var2; 2303 ${FRAGMENT_OUTPUT} 2304 } 2305 "" 2306 end 2307 2308 case writeback_1 2309 version 300 es 2310 desc "write back a varying in the fragment shader" 2311 values 2312 { 2313 input float in0 = [ 1.0 | 0.0 | -2.0 | 10.0 ]; 2314 } 2315 expect compile_fail 2316 vertex "" 2317 #version 300 es 2318 precision mediump float; 2319 ${VERTEX_DECLARATIONS} 2320 out float var1; 2321 out float var2; 2322 2323 void main() 2324 { 2325 var1 = in0; 2326 var2 = var1 + in0; 2327 ${VERTEX_OUTPUT} 2328 } 2329 "" 2330 fragment "" 2331 #version 300 es 2332 precision mediump float; 2333 ${FRAGMENT_DECLARATIONS} 2334 in float var1; 2335 in float var2; 2336 2337 void main() 2338 { 2339 var2 = var1; 2340 out0 = var1; 2341 ${FRAGMENT_OUTPUT} 2342 } 2343 "" 2344 end 2345 end 2346 end 2347 2348 group uniform "Uniform linkage" 2349 group struct "Uniform structs" 2350 # Struct linkage handling 2351 case basic 2352 version 300 es 2353 desc "Same uniform struct in both shaders" 2354 values { 2355 uniform float val.a = 1.0; 2356 uniform float val.b = 2.0; 2357 output float out0 = 3.0; 2358 } 2359 vertex "" 2360 #version 300 es 2361 ${VERTEX_DECLARATIONS} 2362 struct Struct {mediump float a; mediump float b;}; 2363 uniform Struct val; 2364 out mediump float dummy; 2365 void main() 2366 { 2367 dummy = val.a + val.b; 2368 ${VERTEX_OUTPUT} 2369 } 2370 "" 2371 fragment "" 2372 #version 300 es 2373 precision mediump float; 2374 struct Struct {mediump float a; mediump float b;}; 2375 uniform Struct val; 2376 in mediump float dummy; 2377 ${FRAGMENT_DECLARATIONS} 2378 void main() 2379 { 2380 out0 = val.b + val.a; 2381 out0 = out0 + dummy; 2382 out0 = out0 - dummy; 2383 ${FRAGMENT_OUTPUT} 2384 } 2385 "" 2386 end 2387 2388 case vertex_only 2389 version 300 es 2390 desc "Uniform struct declared in both, used only in vertex." 2391 values { 2392 uniform float val.a = 1.0; 2393 uniform float val.b = 2.0; 2394 output float out0 = 3.0; 2395 } 2396 vertex "" 2397 #version 300 es 2398 ${VERTEX_DECLARATIONS} 2399 struct Struct {mediump float a; mediump float b;}; 2400 uniform Struct val; 2401 out mediump float res; 2402 void main() 2403 { 2404 res = val.a + val.b; 2405 ${VERTEX_OUTPUT} 2406 } 2407 "" 2408 fragment "" 2409 #version 300 es 2410 precision mediump float; 2411 struct Struct {mediump float a; mediump float b;}; 2412 uniform Struct val; 2413 in mediump float res; 2414 ${FRAGMENT_DECLARATIONS} 2415 void main() 2416 { 2417 out0 = res; 2418 ${FRAGMENT_OUTPUT} 2419 } 2420 "" 2421 end 2422 2423 case fragment_only 2424 version 300 es 2425 desc "Uniform struct declared in both, used only in fragment." 2426 values { 2427 uniform float val.a = 1.0; 2428 uniform float val.b = 2.0; 2429 output float out0 = 3.0; 2430 } 2431 vertex "" 2432 #version 300 es 2433 ${VERTEX_DECLARATIONS} 2434 struct Struct {mediump float a; mediump float b;}; 2435 uniform Struct val; 2436 void main() 2437 { 2438 ${VERTEX_OUTPUT} 2439 } 2440 "" 2441 fragment "" 2442 #version 300 es 2443 precision mediump float; 2444 struct Struct {mediump float a; mediump float b;}; 2445 uniform Struct val; 2446 ${FRAGMENT_DECLARATIONS} 2447 void main() 2448 { 2449 out0 = val.a + val.b; 2450 ${FRAGMENT_OUTPUT} 2451 } 2452 "" 2453 end 2454 2455 case partial 2456 version 300 es 2457 desc "Uniform struct declared in both, used partially in both." 2458 values { 2459 uniform float val.a = 1.0; 2460 uniform float val.b = 2.0; 2461 output float out0 = 3.0; 2462 } 2463 vertex "" 2464 #version 300 es 2465 ${VERTEX_DECLARATIONS} 2466 struct Struct {mediump float a; mediump float b;}; 2467 uniform Struct val; 2468 out mediump float res; 2469 void main() 2470 { 2471 res = val.a; 2472 ${VERTEX_OUTPUT} 2473 } 2474 "" 2475 fragment "" 2476 #version 300 es 2477 precision mediump float; 2478 struct Struct {mediump float a; mediump float b;}; 2479 uniform Struct val; 2480 ${FRAGMENT_DECLARATIONS} 2481 in mediump float res; 2482 void main() 2483 { 2484 out0 = res + val.b; 2485 ${FRAGMENT_OUTPUT} 2486 } 2487 "" 2488 end 2489 2490 case vec4 2491 version 300 es 2492 desc "Same uniform struct in both shaders. Datatype vec4" 2493 values { 2494 uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); 2495 uniform vec4 val.b = vec4(1.0, 2.0, 3.0, 4.0); 2496 output float out0 = 3.0; 2497 } 2498 vertex "" 2499 #version 300 es 2500 ${VERTEX_DECLARATIONS} 2501 struct Struct {mediump vec4 a; mediump vec4 b;}; 2502 uniform Struct val; 2503 out mediump float dummy; 2504 void main() 2505 { 2506 dummy = val.a.x + val.b.y; 2507 ${VERTEX_OUTPUT} 2508 } 2509 "" 2510 fragment "" 2511 #version 300 es 2512 precision mediump float; 2513 struct Struct {mediump vec4 a; mediump vec4 b;}; 2514 uniform Struct val; 2515 in mediump float dummy; 2516 ${FRAGMENT_DECLARATIONS} 2517 void main() 2518 { 2519 out0 = val.b.y + val.a.x; 2520 out0 = out0 + dummy; 2521 out0 = out0 - dummy; 2522 ${FRAGMENT_OUTPUT} 2523 } 2524 "" 2525 end 2526 2527 case vertex_only_vec4 2528 version 300 es 2529 desc "Uniform struct declared in both, used only in vertex. Datatype vec4 " 2530 values { 2531 uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); 2532 uniform vec4 val.b = vec4(1.0, 2.0, 3.0, 4.0); 2533 output float out0 = 3.0; 2534 } 2535 vertex "" 2536 #version 300 es 2537 ${VERTEX_DECLARATIONS} 2538 struct Struct {mediump vec4 a; mediump vec4 b;}; 2539 uniform Struct val; 2540 out mediump float res; 2541 void main() 2542 { 2543 res = val.a.x + val.b.y; 2544 ${VERTEX_OUTPUT} 2545 } 2546 "" 2547 fragment "" 2548 #version 300 es 2549 precision mediump float; 2550 struct Struct {mediump vec4 a; mediump vec4 b;}; 2551 uniform Struct val; 2552 in mediump float res; 2553 ${FRAGMENT_DECLARATIONS} 2554 void main() 2555 { out0 = res; 2556 ${FRAGMENT_OUTPUT} 2557 } 2558 "" 2559 end 2560 2561 case fragment_only_vec4 2562 version 300 es 2563 desc "Uniform struct declared in both, used only in fragment. Datatype vec4" 2564 values { 2565 uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); 2566 uniform vec4 val.b = vec4(1.0, 2.0, 3.0, 4.0); 2567 output float out0 = 3.0; 2568 } 2569 vertex "" 2570 #version 300 es 2571 ${VERTEX_DECLARATIONS} 2572 struct Struct {mediump vec4 a; mediump vec4 b;}; 2573 uniform Struct val; 2574 void main() 2575 { 2576 ${VERTEX_OUTPUT} 2577 } 2578 "" 2579 fragment "" 2580 #version 300 es 2581 precision mediump float; 2582 struct Struct {mediump vec4 a; mediump vec4 b;}; 2583 uniform Struct val; 2584 ${FRAGMENT_DECLARATIONS} 2585 void main() 2586 { out0 = val.a.x + val.b.y; 2587 ${FRAGMENT_OUTPUT} 2588 } 2589 "" 2590 end 2591 2592 case partial_vec4 2593 version 300 es 2594 desc "Uniform struct declared in both, used partially in both. Datatype vec4" 2595 values { 2596 uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); 2597 uniform vec4 val.b = vec4(1.0, 2.0, 3.0, 4.0); 2598 output float out0 = 3.0; 2599 } 2600 vertex "" 2601 #version 300 es 2602 ${VERTEX_DECLARATIONS} 2603 struct Struct {mediump vec4 a; mediump vec4 b;}; 2604 uniform Struct val; 2605 out mediump float res; 2606 void main() 2607 { 2608 res = val.a.x; 2609 ${VERTEX_OUTPUT} 2610 } 2611 "" 2612 fragment "" 2613 #version 300 es 2614 precision mediump float; 2615 struct Struct {mediump vec4 a; mediump vec4 b;}; 2616 uniform Struct val; 2617 ${FRAGMENT_DECLARATIONS} 2618 in mediump float res; 2619 void main() 2620 { out0 = res + val.b.y; 2621 ${FRAGMENT_OUTPUT} 2622 } 2623 "" 2624 end 2625 2626 case vec4_vec3 2627 version 300 es 2628 desc "Same uniform struct in both shaders. Datatype vec4 and vec3" 2629 values { 2630 uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); 2631 uniform vec3 val.b = vec3(1.0, 2.0, 3.0); 2632 output float out0 = 3.0; 2633 } 2634 vertex "" 2635 #version 300 es 2636 ${VERTEX_DECLARATIONS} 2637 struct Struct {mediump vec4 a; mediump vec3 b;}; 2638 uniform Struct val; 2639 out mediump float dummy; 2640 void main() 2641 { 2642 dummy = val.a.x + val.b.y; 2643 ${VERTEX_OUTPUT} 2644 } 2645 "" 2646 fragment "" 2647 #version 300 es 2648 precision mediump float; 2649 struct Struct {mediump vec4 a; mediump vec3 b;}; 2650 uniform Struct val; 2651 in mediump float dummy; 2652 ${FRAGMENT_DECLARATIONS} 2653 void main() 2654 { out0 = val.b.y + val.a.x; 2655 out0 = out0 + dummy; 2656 out0 = out0 - dummy; 2657 ${FRAGMENT_OUTPUT} 2658 } 2659 "" 2660 end 2661 2662 case vertex_only_vec4_vec3 2663 version 300 es 2664 desc "Uniform struct declared in both, used only in vertex. Datatype vec4 and vec3" 2665 values { 2666 uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); 2667 uniform vec3 val.b = vec3(1.0, 2.0, 3.0); 2668 output float out0 = 3.0; 2669 } 2670 vertex "" 2671 #version 300 es 2672 ${VERTEX_DECLARATIONS} 2673 struct Struct {mediump vec4 a; mediump vec3 b;}; 2674 uniform Struct val; 2675 out mediump float res; 2676 void main() 2677 { 2678 res = val.a.x + val.b.y; 2679 ${VERTEX_OUTPUT} 2680 } 2681 "" 2682 fragment "" 2683 #version 300 es 2684 precision mediump float; 2685 struct Struct {mediump vec4 a; mediump vec3 b;}; 2686 uniform Struct val; 2687 in mediump float res; 2688 ${FRAGMENT_DECLARATIONS} 2689 void main() 2690 { out0 = res; 2691 ${FRAGMENT_OUTPUT} 2692 } 2693 "" 2694 end 2695 2696 case fragment_only_vec4_vec3 2697 version 300 es 2698 desc "Uniform struct declared in both, used only in fragment. Datatype vec4 and vec3" 2699 values { 2700 uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); 2701 uniform vec3 val.b = vec3(1.0, 2.0, 3.0); 2702 output float out0 = 3.0; 2703 } 2704 vertex "" 2705 #version 300 es 2706 ${VERTEX_DECLARATIONS} 2707 struct Struct {mediump vec4 a; mediump vec3 b;}; 2708 uniform Struct val; 2709 void main() 2710 { 2711 ${VERTEX_OUTPUT} 2712 } 2713 "" 2714 fragment "" 2715 #version 300 es 2716 precision mediump float; 2717 struct Struct {mediump vec4 a; mediump vec3 b;}; 2718 uniform Struct val; 2719 ${FRAGMENT_DECLARATIONS} 2720 void main() 2721 { out0 = val.a.x + val.b.y; 2722 ${FRAGMENT_OUTPUT} 2723 } 2724 "" 2725 end 2726 2727 case partial_vec4_vec3 2728 version 300 es 2729 desc "Uniform struct declared in both, used partially in both. Datatype vec4 and vec3" 2730 values { 2731 uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); 2732 uniform vec3 val.b = vec3(1.0, 2.0, 3.0); 2733 output float out0 = 3.0; 2734 } 2735 vertex "" 2736 #version 300 es 2737 ${VERTEX_DECLARATIONS} 2738 struct Struct {mediump vec4 a; mediump vec3 b;}; 2739 uniform Struct val; 2740 out mediump float res; 2741 void main() 2742 { 2743 res = val.a.x; 2744 ${VERTEX_OUTPUT} 2745 } 2746 "" 2747 fragment "" 2748 #version 300 es 2749 precision mediump float; 2750 struct Struct {mediump vec4 a; mediump vec3 b;}; 2751 uniform Struct val; 2752 ${FRAGMENT_DECLARATIONS} 2753 in mediump float res; 2754 void main() 2755 { out0 = res + val.b.y; 2756 ${FRAGMENT_OUTPUT} 2757 } 2758 "" 2759 end 2760 2761 case vec4_float 2762 version 300 es 2763 desc "Same uniform struct in both shaders. Datatype vec4 and float" 2764 values { 2765 uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); 2766 uniform float val.b = 2.0; 2767 output float out0 = 3.0; 2768 } 2769 vertex "" 2770 #version 300 es 2771 ${VERTEX_DECLARATIONS} 2772 struct Struct {mediump vec4 a; mediump float b;}; 2773 uniform Struct val; 2774 out mediump float dummy; 2775 void main() 2776 { 2777 dummy = val.a.x + val.b; 2778 ${VERTEX_OUTPUT} 2779 } 2780 "" 2781 fragment "" 2782 #version 300 es 2783 precision mediump float; 2784 struct Struct {mediump vec4 a; mediump float b;}; 2785 uniform Struct val; 2786 in mediump float dummy; 2787 ${FRAGMENT_DECLARATIONS} 2788 void main() 2789 { out0 = val.b + val.a.x; 2790 out0 = out0 + dummy; 2791 out0 = out0 - dummy; 2792 ${FRAGMENT_OUTPUT} 2793 } 2794 "" 2795 end 2796 2797 case vertex_only_vec4_float 2798 version 300 es 2799 desc "Uniform struct declared in both, used only in vertex. Datatype vec4 and float" 2800 values { 2801 uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); 2802 uniform float val.b = 2.0; 2803 output float out0 = 3.0; 2804 } 2805 vertex "" 2806 #version 300 es 2807 ${VERTEX_DECLARATIONS} 2808 struct Struct {mediump vec4 a; mediump float b;}; 2809 uniform Struct val; 2810 out mediump float res; 2811 void main() 2812 { 2813 res = val.a.x + val.b; 2814 ${VERTEX_OUTPUT} 2815 } 2816 "" 2817 fragment "" 2818 #version 300 es 2819 precision mediump float; 2820 struct Struct {mediump vec4 a; mediump float b;}; 2821 uniform Struct val; 2822 in mediump float res; 2823 ${FRAGMENT_DECLARATIONS} 2824 void main() 2825 { out0 = res; 2826 ${FRAGMENT_OUTPUT} 2827 } 2828 "" 2829 end 2830 2831 case fragment_only_vec4_float 2832 version 300 es 2833 desc "Uniform struct declared in both, used only in fragment. Datatype vec4 and float" 2834 values { 2835 uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); 2836 uniform float val.b = 2.0; 2837 output float out0 = 3.0; 2838 } 2839 vertex "" 2840 #version 300 es 2841 ${VERTEX_DECLARATIONS} 2842 struct Struct {mediump vec4 a; mediump float b;}; 2843 uniform Struct val; 2844 void main() 2845 { 2846 ${VERTEX_OUTPUT} 2847 } 2848 "" 2849 fragment "" 2850 #version 300 es 2851 precision mediump float; 2852 struct Struct {mediump vec4 a; mediump float b;}; 2853 uniform Struct val; 2854 ${FRAGMENT_DECLARATIONS} 2855 void main() 2856 { out0 = val.a.x + val.b; 2857 ${FRAGMENT_OUTPUT} 2858 } 2859 "" 2860 end 2861 2862 case partial_vec4_float 2863 version 300 es 2864 desc "Uniform struct declared in both, used partially in both. Datatype vec4 and float" 2865 values { 2866 uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); 2867 uniform float val.b = 2.0; 2868 output float out0 = 3.0; 2869 } 2870 vertex "" 2871 #version 300 es 2872 ${VERTEX_DECLARATIONS} 2873 struct Struct {mediump vec4 a; mediump float b;}; 2874 uniform Struct val; 2875 out mediump float res; 2876 void main() 2877 { 2878 res = val.a.x; 2879 ${VERTEX_OUTPUT} 2880 } 2881 "" 2882 fragment "" 2883 #version 300 es 2884 precision mediump float; 2885 struct Struct {mediump vec4 a; mediump float b;}; 2886 uniform Struct val; 2887 ${FRAGMENT_DECLARATIONS} 2888 in mediump float res; 2889 void main() 2890 { out0 = res + val.b; 2891 ${FRAGMENT_OUTPUT} 2892 } 2893 "" 2894 end 2895 2896 case partial_vec4_struct 2897 version 300 es 2898 desc "Uniform struct declared in both, used partially in both. Datatype vec4 and struct with vec4" 2899 values { 2900 uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); 2901 uniform vec4 val.b.c = vec4(1.0, 2.0, 3.0, 4.0); 2902 output float out0 = 3.0; 2903 } 2904 vertex "" 2905 #version 300 es 2906 ${VERTEX_DECLARATIONS} 2907 struct Inner {mediump vec4 c;}; 2908 struct Struct {mediump vec4 a; Inner b;}; 2909 uniform Struct val; 2910 out mediump float res; 2911 void main() 2912 { 2913 res = val.a.x; 2914 ${VERTEX_OUTPUT} 2915 } 2916 "" 2917 fragment "" 2918 #version 300 es 2919 precision mediump float; 2920 struct Inner {mediump vec4 c;}; 2921 struct Struct {mediump vec4 a; Inner b;}; 2922 uniform Struct val; 2923 ${FRAGMENT_DECLARATIONS} 2924 in mediump float res; 2925 void main() 2926 { out0 = res + val.b.c.y; 2927 ${FRAGMENT_OUTPUT} 2928 } 2929 "" 2930 end 2931 2932 case partial_vec4_vec3_struct 2933 version 300 es 2934 desc "Uniform struct declared in both, used partially in both. Datatype vec4 and struct with vec3" 2935 values { 2936 uniform vec4 val.a = vec4(1.0, 2.0, 3.0, 4.0); 2937 uniform vec3 val.b.c = vec3(1.0, 2.0, 3.0); 2938 output float out0 = 3.0; 2939 } 2940 vertex "" 2941 #version 300 es 2942 ${VERTEX_DECLARATIONS} 2943 struct Inner {mediump vec3 c;}; 2944 struct Struct {mediump vec4 a; Inner b;}; 2945 uniform Struct val; 2946 out mediump float res; 2947 void main() 2948 { 2949 res = val.a.x; 2950 ${VERTEX_OUTPUT} 2951 } 2952 "" 2953 fragment "" 2954 #version 300 es 2955 precision mediump float; 2956 struct Inner {mediump vec3 c;}; 2957 struct Struct {mediump vec4 a; Inner b;}; 2958 uniform Struct val; 2959 ${FRAGMENT_DECLARATIONS} 2960 in mediump float res; 2961 void main() 2962 { out0 = res + val.b.c.y; 2963 ${FRAGMENT_OUTPUT} 2964 } 2965 "" 2966 end 2967 2968 case partial_vec2_vec3 2969 version 300 es 2970 desc "Uniform struct declared in both, used partially in both. Datatype vec2 and vec3" 2971 values { 2972 uniform vec2 val.a = vec2(1.0, 2.0); 2973 uniform vec3 val.b = vec3(1.0, 2.0, 3.0); 2974 output float out0 = 3.0; 2975 } 2976 vertex "" 2977 #version 300 es 2978 ${VERTEX_DECLARATIONS} 2979 struct Struct {mediump vec2 a; mediump vec3 b;}; 2980 uniform Struct val; 2981 out mediump float res; 2982 void main() 2983 { 2984 res = val.a.x; 2985 ${VERTEX_OUTPUT} 2986 } 2987 "" 2988 fragment "" 2989 #version 300 es 2990 precision mediump float; 2991 struct Struct {mediump vec2 a; mediump vec3 b;}; 2992 uniform Struct val; 2993 ${FRAGMENT_DECLARATIONS} 2994 in mediump float res; 2995 void main() 2996 { out0 = res + val.b.y; 2997 ${FRAGMENT_OUTPUT} 2998 } 2999 "" 3000 end 3001 3002 case partial_vec2_int 3003 version 300 es 3004 desc "Uniform struct declared in both, used partially in both. Datatype vec2 and int" 3005 values { 3006 uniform vec2 val.a = vec2(1.0, 2.0); 3007 uniform int val.b = 2; 3008 output float out0 = 3.0; 3009 } 3010 vertex "" 3011 #version 300 es 3012 ${VERTEX_DECLARATIONS} 3013 struct Struct {mediump vec2 a; mediump int b;}; 3014 uniform Struct val; 3015 out mediump float res; 3016 void main() 3017 { 3018 res = val.a.x; 3019 ${VERTEX_OUTPUT} 3020 } 3021 "" 3022 fragment "" 3023 #version 300 es 3024 precision mediump float; 3025 struct Struct {mediump vec2 a; mediump int b;}; 3026 uniform Struct val; 3027 ${FRAGMENT_DECLARATIONS} 3028 in mediump float res; 3029 void main() 3030 { out0 = res + float(val.b); 3031 ${FRAGMENT_OUTPUT} 3032 } 3033 "" 3034 end 3035 3036 case partial_int_float 3037 version 300 es 3038 desc "Uniform struct declared in both, used partially in both. Datatype int and float" 3039 values { 3040 uniform float val.a = 1.0; 3041 uniform int val.b = 2; 3042 output float out0 = 3.0; 3043 } 3044 vertex "" 3045 #version 300 es 3046 ${VERTEX_DECLARATIONS} 3047 struct Struct {mediump float a; mediump int b;}; 3048 uniform Struct val; 3049 out mediump float res; 3050 void main() 3051 { 3052 res = val.a; 3053 ${VERTEX_OUTPUT} 3054 } 3055 "" 3056 fragment "" 3057 #version 300 es 3058 precision mediump float; 3059 struct Struct {mediump float a; mediump int b;}; 3060 uniform Struct val; 3061 ${FRAGMENT_DECLARATIONS} 3062 in mediump float res; 3063 void main() 3064 { out0 = res + float(val.b); 3065 ${FRAGMENT_OUTPUT} 3066 } 3067 "" 3068 end 3069 3070 case partial_bvec2_vec2 3071 version 300 es 3072 desc "Uniform struct declared in both, used partially in both. Datatype bvec2 and vec2" 3073 values { 3074 uniform bvec2 val.a = bvec2(true, true); 3075 uniform vec2 val.b = vec2(1.0, 2.0); 3076 output float out0 = 3.0; 3077 } 3078 vertex "" 3079 #version 300 es 3080 ${VERTEX_DECLARATIONS} 3081 struct Struct {bvec2 a; mediump vec2 b;}; 3082 uniform Struct val; 3083 out mediump float res; 3084 void main() 3085 { 3086 res = float(val.a.x); 3087 ${VERTEX_OUTPUT} 3088 } 3089 "" 3090 fragment "" 3091 #version 300 es 3092 precision mediump float; 3093 struct Struct {bvec2 a; mediump vec2 b;}; 3094 uniform Struct val; 3095 ${FRAGMENT_DECLARATIONS} 3096 in mediump float res; 3097 void main() 3098 { out0 = res + val.b.y; 3099 ${FRAGMENT_OUTPUT} 3100 } 3101 "" 3102 end 3103 3104 case partial_ivec2_vec2 3105 version 300 es 3106 desc "Uniform struct declared in both, used partially in both. Datatype ivec2 and vec2" 3107 values { 3108 uniform ivec2 val.a = ivec2(1, 2); 3109 uniform vec2 val.b = vec2(1.0, 2.0); 3110 output float out0 = 3.0; 3111 } 3112 vertex "" 3113 #version 300 es 3114 ${VERTEX_DECLARATIONS} 3115 struct Struct {mediump ivec2 a; mediump vec2 b;}; 3116 uniform Struct val; 3117 out mediump float res; 3118 void main() 3119 { 3120 res = vec2(val.a).x; 3121 ${VERTEX_OUTPUT} 3122 } 3123 "" 3124 fragment "" 3125 #version 300 es 3126 precision mediump float; 3127 struct Struct {mediump ivec2 a; mediump vec2 b;}; 3128 uniform Struct val; 3129 ${FRAGMENT_DECLARATIONS} 3130 in mediump float res; 3131 void main() 3132 { out0 = res + val.b.y; 3133 ${FRAGMENT_OUTPUT} 3134 } 3135 "" 3136 end 3137 3138 case partial_ivec2_ivec2 3139 version 300 es 3140 desc "Uniform struct declared in both, used partially in both. Datatype ivec2 and ivec2" 3141 values { 3142 uniform ivec2 val.a = ivec2(1, 2); 3143 uniform ivec2 val.b = ivec2(1, 2); 3144 output float out0 = 3.0; 3145 } 3146 vertex "" 3147 #version 300 es 3148 ${VERTEX_DECLARATIONS} 3149 struct Struct {mediump ivec2 a; mediump ivec2 b;}; 3150 uniform Struct val; 3151 out mediump float res; 3152 void main() 3153 { 3154 res = vec2(val.a).x; 3155 ${VERTEX_OUTPUT} 3156 } 3157 "" 3158 fragment "" 3159 #version 300 es 3160 precision mediump float; 3161 struct Struct {mediump ivec2 a; mediump ivec2 b;}; 3162 uniform Struct val; 3163 ${FRAGMENT_DECLARATIONS} 3164 in mediump float res; 3165 void main() 3166 { out0 = res + vec2(val.b).y; 3167 ${FRAGMENT_OUTPUT} 3168 } 3169 "" 3170 end 3171 3172 case type_conflict_1 3173 version 300 es 3174 desc "Fragment struct has one less member than fragment version" 3175 expect link_fail 3176 values {output float out0 = 3.0;} 3177 vertex "" 3178 #version 300 es 3179 ${VERTEX_DECLARATIONS} 3180 struct Struct {mediump float a; mediump float b;}; 3181 uniform Struct val; 3182 out mediump float res; 3183 void main() 3184 { 3185 res = val.a; 3186 ${VERTEX_OUTPUT} 3187 } 3188 "" 3189 fragment "" 3190 #version 300 es 3191 precision mediump float; 3192 struct Struct {mediump float a;}; 3193 uniform Struct val; 3194 ${FRAGMENT_DECLARATIONS} 3195 in mediump float res; 3196 void main() 3197 { out0 = res + val.a; 3198 ${FRAGMENT_OUTPUT} 3199 } 3200 "" 3201 end 3202 3203 case type_conflict_2 3204 version 300 es 3205 desc "Vertex struct has int, fragment struct has float." 3206 expect link_fail 3207 values {output float out0 = 3.0;} 3208 vertex "" 3209 #version 300 es 3210 ${VERTEX_DECLARATIONS} 3211 struct Struct {mediump int a;}; 3212 uniform Struct val; 3213 out mediump float res; 3214 void main() 3215 { 3216 res = float(val.a); 3217 ${VERTEX_OUTPUT} 3218 } 3219 "" 3220 fragment "" 3221 #version 300 es 3222 precision mediump float; 3223 struct Struct {mediump float a;}; 3224 uniform Struct val; 3225 ${FRAGMENT_DECLARATIONS} 3226 in mediump float res; 3227 void main() 3228 { out0 = val.a; 3229 ${FRAGMENT_OUTPUT} 3230 } 3231 "" 3232 end 3233 3234 case type_conflict_3 3235 version 300 es 3236 desc "Vertex struct has vec3, fragment struct has vec4." 3237 expect link_fail 3238 values {output float out0 = 3.0;} 3239 vertex "" 3240 #version 300 es 3241 ${VERTEX_DECLARATIONS} 3242 struct Struct {mediump vec3 a;}; 3243 uniform Struct val; 3244 out mediump float res; 3245 void main() 3246 { 3247 res = float(val.a.x); 3248 ${VERTEX_OUTPUT} 3249 } 3250 "" 3251 fragment "" 3252 #version 300 es 3253 precision mediump float; 3254 struct Struct {mediump vec4 a;}; 3255 uniform Struct val; 3256 ${FRAGMENT_DECLARATIONS} 3257 in mediump float res; 3258 void main() 3259 { out0 = val.a.x; 3260 ${FRAGMENT_OUTPUT} 3261 } 3262 "" 3263 end 3264 3265 case precision_conflict_1 3266 version 300 es 3267 desc "Vertex side struct has highp, fragment side struct mediump." 3268 expect link_fail 3269 values {output float out0 = 3.0;} 3270 vertex "" 3271 #version 300 es 3272 ${VERTEX_DECLARATIONS} 3273 struct Struct {highp float a;}; 3274 uniform Struct val; 3275 out mediump float res; 3276 void main() 3277 { 3278 res = val.a; 3279 ${VERTEX_OUTPUT} 3280 } 3281 "" 3282 fragment "" 3283 #version 300 es 3284 precision mediump float; 3285 struct Struct {mediump float a;}; 3286 uniform Struct val; 3287 ${FRAGMENT_DECLARATIONS} 3288 in mediump float res; 3289 void main() 3290 { out0 = val.a; 3291 ${FRAGMENT_OUTPUT} 3292 } 3293 "" 3294 end 3295 3296 case precision_conflict_2 3297 version 300 es 3298 desc "Vertex side struct has mediump, fragment side struct lowp." 3299 expect link_fail 3300 values {output float out0 = 3.0;} 3301 vertex "" 3302 #version 300 es 3303 ${VERTEX_DECLARATIONS} 3304 struct Struct {mediump float a;}; 3305 uniform Struct val; 3306 out mediump float res; 3307 void main() 3308 { 3309 res = val.a; 3310 ${VERTEX_OUTPUT} 3311 } 3312 "" 3313 fragment "" 3314 #version 300 es 3315 precision mediump float; 3316 struct Struct {lowp float a;}; 3317 uniform Struct val; 3318 ${FRAGMENT_DECLARATIONS} 3319 in mediump float res; 3320 void main() 3321 { out0 = val.a; 3322 ${FRAGMENT_OUTPUT} 3323 } 3324 "" 3325 end 3326 3327 case precision_conflict_3 3328 version 300 es 3329 desc "Vertex side struct has lowp, fragment side struct mediump." 3330 expect link_fail 3331 values {output float out0 = 3.0;} 3332 vertex "" 3333 #version 300 es 3334 ${VERTEX_DECLARATIONS} 3335 struct Struct {lowp float a;}; 3336 uniform Struct val; 3337 out mediump float res; 3338 void main() 3339 { 3340 res = val.a; 3341 ${VERTEX_OUTPUT} 3342 } 3343 "" 3344 fragment "" 3345 #version 300 es 3346 precision mediump float; 3347 struct Struct {mediump float a;}; 3348 uniform Struct val; 3349 ${FRAGMENT_DECLARATIONS} 3350 in mediump float res; 3351 void main() 3352 { out0 = val.a; 3353 ${FRAGMENT_OUTPUT} 3354 } 3355 "" 3356 end 3357 3358 case precision_conflict_4 3359 version 300 es 3360 desc "Vertex side struct has lowp, fragment side struct implicit mediump." 3361 expect link_fail 3362 values {output float out0 = 3.0;} 3363 vertex "" 3364 #version 300 es 3365 ${VERTEX_DECLARATIONS} 3366 struct Struct {lowp float a;}; 3367 uniform Struct val; 3368 out mediump float res; 3369 void main() 3370 { 3371 res = val.a; 3372 ${VERTEX_OUTPUT} 3373 } 3374 "" 3375 fragment "" 3376 #version 300 es 3377 precision mediump float; 3378 struct Struct {float a;}; 3379 uniform Struct val; 3380 ${FRAGMENT_DECLARATIONS} 3381 in mediump float res; 3382 void main() 3383 { out0 = val.a; 3384 ${FRAGMENT_OUTPUT} 3385 } 3386 "" 3387 end 3388 3389 case light_struct_highp 3390 version 300 es 3391 desc "Complex Light struct from use case tests." 3392 values { 3393 uniform float val.constantAttenuation = 1.0; 3394 uniform float val.quadraticAttenuation = 1.0; 3395 output float out0 = 2.0; 3396 } 3397 vertex "" 3398 #version 300 es 3399 struct Light 3400 { 3401 mediump vec3 color; 3402 highp vec4 position; 3403 highp vec3 direction; 3404 mediump float constantAttenuation; 3405 mediump float linearAttenuation; 3406 mediump float quadraticAttenuation; 3407 }; 3408 ${VERTEX_DECLARATIONS} 3409 uniform Light val; 3410 out mediump float res; 3411 void main() 3412 { 3413 res = val.constantAttenuation; 3414 ${VERTEX_OUTPUT} 3415 } 3416 "" 3417 fragment "" 3418 #version 300 es 3419 precision mediump float; 3420 struct Light 3421 { 3422 mediump vec3 color; 3423 highp vec4 position; 3424 highp vec3 direction; 3425 mediump float constantAttenuation; 3426 mediump float linearAttenuation; 3427 mediump float quadraticAttenuation; 3428 }; 3429 struct Struct {float a;}; 3430 uniform Light val; 3431 ${FRAGMENT_DECLARATIONS} 3432 in mediump float res; 3433 void main() 3434 { 3435 out0 = res + val.quadraticAttenuation; 3436 ${FRAGMENT_OUTPUT} 3437 } 3438 "" 3439 end 3440 3441 case light_struct_mediump 3442 version 300 es 3443 desc "Complex Light struct from use case tests, without highp usage" 3444 values { 3445 uniform float val.constantAttenuation = 1.0; 3446 uniform float val.quadraticAttenuation = 1.0; 3447 output float out0 = 2.0; 3448 } 3449 vertex "" 3450 #version 300 es 3451 struct Light 3452 { 3453 mediump vec3 color; 3454 mediump vec4 position; 3455 mediump vec3 direction; 3456 mediump float constantAttenuation; 3457 mediump float linearAttenuation; 3458 mediump float quadraticAttenuation; 3459 }; 3460 ${VERTEX_DECLARATIONS} 3461 uniform Light val; 3462 out mediump float res; 3463 void main() 3464 { 3465 res = val.constantAttenuation; 3466 ${VERTEX_OUTPUT} 3467 } 3468 "" 3469 fragment "" 3470 #version 300 es 3471 precision mediump float; 3472 struct Light 3473 { 3474 mediump vec3 color; 3475 mediump vec4 position; 3476 mediump vec3 direction; 3477 mediump float constantAttenuation; 3478 mediump float linearAttenuation; 3479 mediump float quadraticAttenuation; 3480 }; 3481 struct Struct {float a;}; 3482 uniform Light val; 3483 ${FRAGMENT_DECLARATIONS} 3484 in mediump float res; 3485 void main() 3486 { 3487 out0 = res + val.quadraticAttenuation; 3488 ${FRAGMENT_OUTPUT} 3489 } 3490 "" 3491 end 3492 end 3493 3494 group block "Uniform blocks" 3495 case precision_mismatch 3496 version 300 es 3497 expect link_fail 3498 vertex "" 3499 #version 300 es 3500 3501 uniform Block 3502 { 3503 highp vec4 val; 3504 }; 3505 3506 ${VERTEX_DECLARATIONS} 3507 out mediump float res; 3508 void main() 3509 { 3510 res = val.x; 3511 ${VERTEX_OUTPUT} 3512 } 3513 "" 3514 fragment "" 3515 #version 300 es 3516 3517 uniform Block 3518 { 3519 mediump vec4 val; 3520 }; 3521 3522 precision mediump float; 3523 ${FRAGMENT_DECLARATIONS} 3524 in mediump float res; 3525 void main() 3526 { 3527 dEQP_FragColor = val; 3528 } 3529 "" 3530 end 3531 3532 case type_mismatch 3533 version 300 es 3534 expect link_fail 3535 vertex "" 3536 #version 300 es 3537 3538 uniform Block 3539 { 3540 highp vec4 val; 3541 }; 3542 3543 ${VERTEX_DECLARATIONS} 3544 out mediump float res; 3545 void main() 3546 { 3547 res = val.x; 3548 ${VERTEX_OUTPUT} 3549 } 3550 "" 3551 fragment "" 3552 #version 300 es 3553 3554 uniform Block 3555 { 3556 highp vec3 val; 3557 }; 3558 3559 precision mediump float; 3560 ${FRAGMENT_DECLARATIONS} 3561 in mediump float res; 3562 void main() 3563 { 3564 dEQP_FragColor = vec4(val, 1.0); 3565 } 3566 "" 3567 end 3568 3569 case members_mismatch 3570 version 300 es 3571 expect link_fail 3572 vertex "" 3573 #version 300 es 3574 3575 uniform Block 3576 { 3577 highp vec4 val; 3578 }; 3579 3580 ${VERTEX_DECLARATIONS} 3581 out mediump float res; 3582 void main() 3583 { 3584 res = val.x; 3585 ${VERTEX_OUTPUT} 3586 } 3587 "" 3588 fragment "" 3589 #version 300 es 3590 3591 uniform Block 3592 { 3593 highp vec4 val; 3594 lowp uint u; 3595 }; 3596 3597 precision mediump float; 3598 ${FRAGMENT_DECLARATIONS} 3599 in mediump float res; 3600 void main() 3601 { 3602 dEQP_FragColor = vec4(val); 3603 } 3604 "" 3605 end 3606 3607 case layout_qualifier_mismatch_1 3608 version 300 es 3609 expect link_fail 3610 vertex "" 3611 #version 300 es 3612 3613 layout(std140) uniform Block 3614 { 3615 highp vec4 val; 3616 }; 3617 3618 ${VERTEX_DECLARATIONS} 3619 out mediump float res; 3620 void main() 3621 { 3622 res = val.x; 3623 ${VERTEX_OUTPUT} 3624 } 3625 "" 3626 fragment "" 3627 #version 300 es 3628 3629 uniform Block 3630 { 3631 highp vec4 val; 3632 }; 3633 3634 precision mediump float; 3635 ${FRAGMENT_DECLARATIONS} 3636 in mediump float res; 3637 void main() 3638 { 3639 dEQP_FragColor = vec4(val); 3640 } 3641 "" 3642 end 3643 3644 case layout_qualifier_mismatch_2 3645 version 300 es 3646 expect link_fail 3647 vertex "" 3648 #version 300 es 3649 3650 layout(shared) uniform Block 3651 { 3652 highp vec4 val; 3653 }; 3654 3655 ${VERTEX_DECLARATIONS} 3656 out mediump float res; 3657 void main() 3658 { 3659 res = val.x; 3660 ${VERTEX_OUTPUT} 3661 } 3662 "" 3663 fragment "" 3664 #version 300 es 3665 3666 layout(packed) uniform Block 3667 { 3668 highp vec4 val; 3669 }; 3670 3671 precision mediump float; 3672 ${FRAGMENT_DECLARATIONS} 3673 in mediump float res; 3674 void main() 3675 { 3676 dEQP_FragColor = vec4(val); 3677 } 3678 "" 3679 end 3680 3681 case layout_qualifier_mismatch_3 3682 version 300 es 3683 expect link_fail 3684 vertex "" 3685 #version 300 es 3686 3687 layout(row_major) uniform Block 3688 { 3689 highp vec4 val; 3690 }; 3691 3692 ${VERTEX_DECLARATIONS} 3693 out mediump float res; 3694 void main() 3695 { 3696 res = val.x; 3697 ${VERTEX_OUTPUT} 3698 } 3699 "" 3700 fragment "" 3701 #version 300 es 3702 3703 layout(column_major) uniform Block 3704 { 3705 highp vec4 val; 3706 }; 3707 3708 precision mediump float; 3709 ${FRAGMENT_DECLARATIONS} 3710 in mediump float res; 3711 void main() 3712 { 3713 dEQP_FragColor = vec4(val); 3714 } 3715 "" 3716 end 3717 3718 case layout_qualifier_mismatch_4 3719 version 300 es 3720 expect link_fail 3721 vertex "" 3722 #version 300 es 3723 3724 layout(row_major) uniform Block 3725 { 3726 highp mat3 val; 3727 }; 3728 3729 ${VERTEX_DECLARATIONS} 3730 out mediump float res; 3731 void main() 3732 { 3733 res = val[0][1]; 3734 ${VERTEX_OUTPUT} 3735 } 3736 "" 3737 fragment "" 3738 #version 300 es 3739 3740 layout(column_major) uniform Block 3741 { 3742 highp mat3 val; 3743 }; 3744 3745 precision mediump float; 3746 ${FRAGMENT_DECLARATIONS} 3747 in mediump float res; 3748 void main() 3749 { 3750 dEQP_FragColor = vec4(val[2], 1.0); 3751 } 3752 "" 3753 end 3754 3755 case layout_qualifier_mismatch_5 3756 version 300 es 3757 expect link_fail 3758 vertex "" 3759 #version 300 es 3760 3761 uniform Block 3762 { 3763 layout(row_major) uniform highp mat3 val; 3764 }; 3765 3766 ${VERTEX_DECLARATIONS} 3767 out mediump float res; 3768 void main() 3769 { 3770 res = val[0][1]; 3771 ${VERTEX_OUTPUT} 3772 } 3773 "" 3774 fragment "" 3775 #version 300 es 3776 3777 uniform Block 3778 { 3779 layout(column_major) uniform highp mat3 val; 3780 }; 3781 3782 precision mediump float; 3783 ${FRAGMENT_DECLARATIONS} 3784 in mediump float res; 3785 void main() 3786 { 3787 dEQP_FragColor = vec4(val[2], 1.0); 3788 } 3789 "" 3790 end 3791 end 3792 end 3793