1 #ifndef _ES31CARRAYOFARRAYSTESTS_HPP 2 #define _ES31CARRAYOFARRAYSTESTS_HPP 3 /*------------------------------------------------------------------------- 4 * OpenGL Conformance Test Suite 5 * ----------------------------- 6 * 7 * Copyright (c) 2014-2016 The Khronos Group Inc. 8 * 9 * Licensed under the Apache License, Version 2.0 (the "License"); 10 * you may not use this file except in compliance with the License. 11 * You may obtain a copy of the License at 12 * 13 * http://www.apache.org/licenses/LICENSE-2.0 14 * 15 * Unless required by applicable law or agreed to in writing, software 16 * distributed under the License is distributed on an "AS IS" BASIS, 17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 * See the License for the specific language governing permissions and 19 * limitations under the License. 20 * 21 */ /*! 22 * \file 23 * \brief 24 */ /*-------------------------------------------------------------------*/ 25 26 #include <map> 27 28 #include "glcTestCase.hpp" 29 #include "glwDefs.hpp" 30 #include "glwEnums.hpp" 31 #include "tcuDefs.hpp" 32 #include "tes31TestCase.hpp" 33 34 namespace glcts 35 { 36 typedef enum { 37 VAR_TYPE_BOOL, 38 VAR_TYPE_INT, 39 VAR_TYPE_UINT, 40 VAR_TYPE_FLOAT, 41 VAR_TYPE_VEC2, 42 VAR_TYPE_VEC3, 43 VAR_TYPE_VEC4, 44 VAR_TYPE_BVEC2, 45 VAR_TYPE_BVEC3, 46 VAR_TYPE_BVEC4, 47 VAR_TYPE_IVEC2, 48 VAR_TYPE_IVEC3, 49 VAR_TYPE_IVEC4, 50 VAR_TYPE_UVEC2, 51 VAR_TYPE_UVEC3, 52 VAR_TYPE_UVEC4, 53 VAR_TYPE_MAT2, 54 VAR_TYPE_MAT3, 55 VAR_TYPE_MAT4, 56 VAR_TYPE_MAT2X2, 57 VAR_TYPE_MAT2X3, 58 VAR_TYPE_MAT2X4, 59 VAR_TYPE_MAT3X2, 60 VAR_TYPE_MAT3X3, 61 VAR_TYPE_MAT3X4, 62 VAR_TYPE_MAT4X2, 63 VAR_TYPE_MAT4X3, 64 VAR_TYPE_MAT4X4, 65 /** List of all supported interface resource types. */ 66 VAR_TYPE_IMAGEBUFFER, 67 VAR_TYPE_IIMAGEBUFFER, 68 VAR_TYPE_UIMAGEBUFFER, 69 VAR_TYPE_SAMPLERBUFFER, 70 VAR_TYPE_ISAMPLERBUFFER, 71 VAR_TYPE_USAMPLERBUFFER, 72 /** List of all supported opaque types. */ 73 //Floating Point Sampler Types (opaque) 74 VAR_TYPE_SAMPLER2D, 75 VAR_TYPE_SAMPLER3D, 76 VAR_TYPE_SAMPLERCUBE, 77 VAR_TYPE_SAMPLERCUBESHADOW, 78 VAR_TYPE_SAMPLER2DSHADOW, 79 VAR_TYPE_SAMPLER2DARRAY, 80 VAR_TYPE_SAMPLER2DARRAYSHADOW, 81 //Signed Integer Sampler Types (opaque) 82 VAR_TYPE_ISAMPLER2D, 83 VAR_TYPE_ISAMPLER3D, 84 VAR_TYPE_ISAMPLERCUBE, 85 VAR_TYPE_ISAMPLER2DARRAY, 86 //Unsigned Integer Sampler Types (opaque) 87 VAR_TYPE_USAMPLER2D, 88 VAR_TYPE_USAMPLER3D, 89 VAR_TYPE_USAMPLERCUBE, 90 VAR_TYPE_USAMPLER2DARRAY, 91 /* Double types */ 92 VAR_TYPE_DOUBLE, 93 VAR_TYPE_DMAT2, 94 VAR_TYPE_DMAT3, 95 VAR_TYPE_DMAT4, 96 VAR_TYPE_DMAT2X2, 97 VAR_TYPE_DMAT2X3, 98 VAR_TYPE_DMAT2X4, 99 VAR_TYPE_DMAT3X2, 100 VAR_TYPE_DMAT3X3, 101 VAR_TYPE_DMAT3X4, 102 VAR_TYPE_DMAT4X2, 103 VAR_TYPE_DMAT4X3, 104 VAR_TYPE_DMAT4X4, 105 } test_var_type; 106 107 struct var_descriptor 108 { 109 std::string type; 110 std::string precision; 111 std::string initializer_with_ones; 112 std::string initializer_with_zeroes; 113 std::string iterator_initialization; 114 std::string iterator_type; 115 std::string specific_element; 116 std::string variable_type_initializer1; 117 std::string variable_type_initializer2; 118 std::string coord_param_for_texture_function; 119 std::string type_of_result_of_texture_function; 120 }; 121 122 // This iterator and map are used to simplify the lookup of type names, initialisation 123 // values, etc., associated with each of the types used within the array tests 124 typedef std::map<glcts::test_var_type, var_descriptor> _supported_variable_types_map; 125 typedef _supported_variable_types_map::const_iterator _supported_variable_types_map_const_iterator; 126 127 /* Groups all tests that verify "arrays of arrays" functionality */ 128 class ArrayOfArraysTestGroup : public glcts::TestCaseGroup 129 { 130 public: 131 /* Public methods */ 132 ArrayOfArraysTestGroup(Context& context); 133 134 virtual void init(void); 135 }; 136 137 /* Groups all tests that verify "arrays of arrays" functionality */ 138 class ArrayOfArraysTestGroupGL : public glcts::TestCaseGroup 139 { 140 public: 141 /* Public methods */ 142 ArrayOfArraysTestGroupGL(Context& context); 143 144 virtual void init(void); 145 }; 146 147 namespace ArraysOfArrays 148 { 149 namespace Interface 150 { 151 /** Represents ES 3.1 core capabilities **/ 152 struct ES 153 { 154 enum 155 { 156 ALLOW_UNSIZED_DECLARATION = 0 157 }; 158 enum 159 { 160 ALLOW_A_OF_A_ON_INTERFACE_BLOCKS = 0 161 }; 162 enum 163 { 164 ALLOW_IN_OUT_INTERFACE_BLOCKS = 0 165 }; 166 enum 167 { 168 USE_ALL_SHADER_STAGES = 0 169 }; 170 enum 171 { 172 USE_ATOMIC = 0 173 }; 174 enum 175 { 176 USE_DOUBLE = 0 177 }; 178 enum 179 { 180 USE_SUBROUTINE = 0 181 }; 182 enum 183 { 184 USE_STORAGE_BLOCK = 0 185 }; 186 187 static const size_t MAX_ARRAY_DIMENSIONS; 188 static const test_var_type* var_types; 189 static const size_t n_var_types; 190 191 static const char* shader_version_gpu5; 192 static const char* shader_version; 193 194 static const char* test_group_name; 195 }; 196 197 /** Represents GL 4.3 core capabilities **/ 198 struct GL 199 { 200 enum 201 { 202 ALLOW_UNSIZED_DECLARATION = 1 203 }; 204 enum 205 { 206 ALLOW_A_OF_A_ON_INTERFACE_BLOCKS = 1 207 }; 208 enum 209 { 210 ALLOW_IN_OUT_INTERFACE_BLOCKS = 1 211 }; 212 enum 213 { 214 USE_ALL_SHADER_STAGES = 1 215 }; 216 enum 217 { 218 USE_ATOMIC = 1 219 }; 220 enum 221 { 222 USE_DOUBLE = 1 223 }; 224 enum 225 { 226 USE_SUBROUTINE = 1 227 }; 228 enum 229 { 230 USE_STORAGE_BLOCK = 1 231 }; 232 233 static const size_t MAX_ARRAY_DIMENSIONS; 234 static const test_var_type* var_types; 235 static const size_t n_var_types; 236 237 static const char* shader_version_gpu5; 238 static const char* shader_version; 239 }; 240 } /* Interface */ 241 242 /** Base test class for all arrays_of_arrays tests 243 **/ 244 template <class API> 245 class TestCaseBase : public tcu::TestCase 246 { 247 public: 248 TestCaseBase(Context& context, const char* name, const char* description); 249 ~TestCaseBase(void)250 virtual ~TestCaseBase(void) 251 { 252 } 253 254 virtual void deinit(void); 255 virtual void delete_objects(void); 256 virtual tcu::TestNode::IterateResult iterate(); 257 258 protected: 259 /* Protected declarations */ 260 enum TestShaderType 261 { 262 FRAGMENT_SHADER_TYPE, 263 VERTEX_SHADER_TYPE, 264 COMPUTE_SHADER_TYPE, 265 GEOMETRY_SHADER_TYPE, 266 TESSELATION_CONTROL_SHADER_TYPE, 267 TESSELATION_EVALUATION_SHADER_TYPE, 268 269 /* */ 270 SHADER_TYPE_LAST 271 }; 272 273 /* Protected methods */ 274 virtual std::string extend_string(std::string base_string, std::string sub_script, size_t number_of_elements); 275 276 virtual glw::GLint compile_shader_and_get_compilation_result( 277 const std::string& tested_snippet, typename TestCaseBase<API>::TestShaderType tested_shader_type, 278 bool require_gpu_shader5 = false); 279 280 virtual tcu::TestNode::IterateResult execute_negative_test( 281 typename TestCaseBase<API>::TestShaderType tested_shader_type, const std::string& shader_source); 282 283 virtual tcu::TestNode::IterateResult execute_positive_test(const std::string& vertex_shader_source, 284 const std::string& fragment_shader_source, 285 bool delete_generated_objects, bool require_gpu_shader5); 286 287 virtual tcu::TestNode::IterateResult execute_positive_test(const std::string& vertex_shader_source, 288 const std::string& tess_ctrl_shader_source, 289 const std::string& tess_eval_shader_source, 290 const std::string& geometry_shader_source, 291 const std::string& fragment_shader_source, 292 const std::string& compute_shader_source, 293 bool delete_generated_objects, bool require_gpu_shader5); 294 295 virtual void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type) = 0; 296 297 /* Protected fields */ 298 Context& context_id; 299 glw::GLint program_object_id; 300 301 private: 302 /* Private fields */ 303 glw::GLint compute_shader_object_id; 304 glw::GLint fragment_shader_object_id; 305 glw::GLint geometry_shader_object_id; 306 glw::GLint tess_ctrl_shader_object_id; 307 glw::GLint tess_eval_shader_object_id; 308 glw::GLint vertex_shader_object_id; 309 }; 310 311 template <class API> 312 class SizedDeclarationsPrimitive : public TestCaseBase<API> 313 { 314 public: 315 /* Public methods */ SizedDeclarationsPrimitive(Context & context)316 SizedDeclarationsPrimitive(Context& context) 317 : TestCaseBase<API>(context, "SizedDeclarationsPrimitive", 318 " Verify that declarations of variables containing between 2 and 8\n" 319 " sized dimensions of each primitive type are permitted.\n") 320 { 321 /* Left empty on purpose */ 322 } 323 ~SizedDeclarationsPrimitive()324 virtual ~SizedDeclarationsPrimitive() 325 { 326 /* Left empty on purpose */ 327 } 328 329 protected: 330 /* Protected methods */ 331 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 332 }; 333 334 template <class API> 335 class SizedDeclarationsStructTypes1 : public TestCaseBase<API> 336 { 337 public: 338 /* Public methods */ SizedDeclarationsStructTypes1(Context & context)339 SizedDeclarationsStructTypes1(Context& context) 340 : TestCaseBase<API>(context, "SizedDeclarationsStructTypes1", 341 " Declare a structure type containing both ints and floats, and verify\n" 342 " that variables having between 2 and 8 sized dimensions of this type\n" 343 " can be declared.\n") 344 { 345 /* Left empty on purpose */ 346 } 347 ~SizedDeclarationsStructTypes1()348 virtual ~SizedDeclarationsStructTypes1() 349 { 350 /* Left empty on purpose */ 351 } 352 353 protected: 354 /* Protected methods */ 355 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 356 }; 357 358 template <class API> 359 class SizedDeclarationsStructTypes2 : public TestCaseBase<API> 360 { 361 public: 362 /* Public methods */ SizedDeclarationsStructTypes2(Context & context)363 SizedDeclarationsStructTypes2(Context& context) 364 : TestCaseBase<API>(context, "SizedDeclarationsStructTypes2", 365 " Verify that a single declaration containing multiple\n" 366 " variables with different numbers of array dimensions is accepted,\n" 367 " e.g. float [2][2] x2, x3[2], x4[2][2], etc) with each variable\n" 368 " having between two and eight dimensions when there are\n" 369 " declarations within the structure body.\n") 370 { 371 /* Left empty on purpose */ 372 } 373 ~SizedDeclarationsStructTypes2()374 virtual ~SizedDeclarationsStructTypes2() 375 { 376 /* Left empty on purpose */ 377 } 378 379 protected: 380 /* Protected methods */ 381 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 382 }; 383 384 template <class API> 385 class SizedDeclarationsStructTypes3 : public TestCaseBase<API> 386 { 387 public: 388 /* Public methods */ SizedDeclarationsStructTypes3(Context & context)389 SizedDeclarationsStructTypes3(Context& context) 390 : TestCaseBase<API>(context, "SizedDeclarationsStructTypes3", 391 " Declare a structure type containing both ints and floats, and verify\n" 392 " that variables having between 2 and 8 sized dimensions of this type\n" 393 " can be declared, with a structure containing an array.\n") 394 { 395 /* Left empty on purpose */ 396 } 397 ~SizedDeclarationsStructTypes3()398 virtual ~SizedDeclarationsStructTypes3() 399 { 400 /* Left empty on purpose */ 401 } 402 403 protected: 404 /* Protected methods */ 405 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 406 }; 407 408 template <class API> 409 class SizedDeclarationsStructTypes4 : public TestCaseBase<API> 410 { 411 public: 412 /* Public methods */ SizedDeclarationsStructTypes4(Context & context)413 SizedDeclarationsStructTypes4(Context& context) 414 : TestCaseBase<API>(context, "SizedDeclarationsStructTypes4", 415 " Declare a structure type containing an array, and verify\n" 416 " that variables having between 2 and 8 sized dimensions of this type\n" 417 " can be declared when the structure definition is included in the \n" 418 " variable definition.\n") 419 { 420 /* Left empty on purpose */ 421 } 422 ~SizedDeclarationsStructTypes4()423 virtual ~SizedDeclarationsStructTypes4() 424 { 425 /* Left empty on purpose */ 426 } 427 428 protected: 429 /* Protected methods */ 430 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 431 }; 432 433 template <class API> 434 class SizedDeclarationsTypenameStyle1 : public TestCaseBase<API> 435 { 436 public: 437 /* Public methods */ SizedDeclarationsTypenameStyle1(Context & context)438 SizedDeclarationsTypenameStyle1(Context& context) 439 : TestCaseBase<API>(context, "SizedDeclarationsTypenameStyle1", 440 " Verify that an 8-dimensional array of floats can be declared with\n" 441 " any placement of the brackets (e.g. float[2]\n" 442 " x[2][2][2][2][2][2][2], float [2][2] x [2][2][2][2][2][2], etc) (9\n" 443 " cases).\n") 444 { 445 /* Left empty on purpose */ 446 } 447 ~SizedDeclarationsTypenameStyle1()448 virtual ~SizedDeclarationsTypenameStyle1() 449 { 450 /* Left empty on purpose */ 451 } 452 453 protected: 454 /* Protected methods */ 455 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 456 }; 457 458 template <class API> 459 class SizedDeclarationsTypenameStyle2 : public TestCaseBase<API> 460 { 461 public: 462 /* Public methods */ SizedDeclarationsTypenameStyle2(Context & context)463 SizedDeclarationsTypenameStyle2(Context& context) 464 : TestCaseBase<API>(context, "SizedDeclarationsTypenameStyle2", 465 " Verify that a single declaration containing multiple\n" 466 " variables with different numbers of array dimensions is accepted,\n" 467 " e.g. float [2][2] x2, x3[2], x4[2][2], etc) with each variable\n" 468 " having between two and eight dimensions. Repeat these tests for\n" 469 " declarations within a structure body.\n") 470 { 471 /* Left empty on purpose */ 472 } 473 ~SizedDeclarationsTypenameStyle2()474 virtual ~SizedDeclarationsTypenameStyle2() 475 { 476 /* Left empty on purpose */ 477 } 478 479 protected: 480 /* Protected methods */ 481 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 482 }; 483 484 template <class API> 485 class SizedDeclarationsTypenameStyle3 : public TestCaseBase<API> 486 { 487 public: 488 /* Public methods */ SizedDeclarationsTypenameStyle3(Context & context)489 SizedDeclarationsTypenameStyle3(Context& context) 490 : TestCaseBase<API>(context, "SizedDeclarationsTypenameStyle3", 491 " Verify that a single declaration, within a structure body,\n" 492 " is accepted when it contains multiple variables with different\n" 493 " numbers of array dimensions, \n" 494 " e.g. float [2][2] x2, x3[2], x4[2][2], etc), with each variable\n" 495 " having between two and eight dimensions.\n" 496 " The variables should be declared within a structure body.\n") 497 { 498 /* Left empty on purpose */ 499 } 500 ~SizedDeclarationsTypenameStyle3()501 virtual ~SizedDeclarationsTypenameStyle3() 502 { 503 /* Left empty on purpose */ 504 } 505 506 protected: 507 /* Protected methods */ 508 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 509 }; 510 511 template <class API> 512 class SizedDeclarationsTypenameStyle4 : public TestCaseBase<API> 513 { 514 public: 515 /* Public methods */ SizedDeclarationsTypenameStyle4(Context & context)516 SizedDeclarationsTypenameStyle4(Context& context) 517 : TestCaseBase<API>(context, "SizedDeclarationsTypenameStyle4", 518 " Verify that an 8-dimensional array of floats can be declared with\n" 519 " any placement of the brackets (e.g. float[2]\n" 520 " x[2][2][2][2][2][2][2], float [2][2] x [2][2][2][2][2][2], etc) (9\n" 521 " cases) within a structure body.\n") 522 { 523 /* Left empty on purpose */ 524 } 525 ~SizedDeclarationsTypenameStyle4()526 virtual ~SizedDeclarationsTypenameStyle4() 527 { 528 /* Left empty on purpose */ 529 } 530 531 protected: 532 /* Protected methods */ 533 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 534 }; 535 536 template <class API> 537 class SizedDeclarationsTypenameStyle5 : public TestCaseBase<API> 538 { 539 public: 540 /* Public methods */ SizedDeclarationsTypenameStyle5(Context & context)541 SizedDeclarationsTypenameStyle5(Context& context) 542 : TestCaseBase<API>(context, "SizedDeclarationsTypenameStyle5", 543 " Verify that a single declaration containing multiple\n" 544 " variables with different numbers of array dimensions is accepted,\n" 545 " within a structure body\n" 546 " e.g. float [2][2] x2, x3[2], x4[2][2], etc) with each variable\n" 547 " having between two and eight dimensions.\n") 548 { 549 /* Left empty on purpose */ 550 } 551 ~SizedDeclarationsTypenameStyle5()552 virtual ~SizedDeclarationsTypenameStyle5() 553 { 554 /* Left empty on purpose */ 555 } 556 557 protected: 558 /* Protected methods */ 559 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 560 }; 561 562 template <class API> 563 class SizedDeclarationsFunctionParams : public TestCaseBase<API> 564 { 565 public: 566 /* Public methods */ SizedDeclarationsFunctionParams(Context & context)567 SizedDeclarationsFunctionParams(Context& context) 568 : TestCaseBase<API>(context, "SizedDeclarationsFunctionParams", 569 " Declare a function having eight parameters, each a float array\n" 570 " with a different number of dimensions between 1 and 8, and verify\n" 571 " that the compiler accepts this. Declare a variable with matching\n" 572 " shape for each parameter, and verify that the function can be\n" 573 " called with these variables as arguments. Interchange each pair\n" 574 " of arguments and verify that the shader is correctly rejected due\n" 575 " to mismatched arguments (28 total cases).\n") 576 { 577 /* Left empty on purpose */ 578 } 579 ~SizedDeclarationsFunctionParams()580 virtual ~SizedDeclarationsFunctionParams() 581 { 582 /* Left empty on purpose */ 583 } 584 585 protected: 586 /* Protected methods */ 587 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 588 }; 589 590 template <class API> 591 class sized_declarations_invalid_sizes1 : public TestCaseBase<API> 592 { 593 public: 594 /* Public methods */ sized_declarations_invalid_sizes1(Context & context)595 sized_declarations_invalid_sizes1(Context& context) 596 : TestCaseBase<API>(context, "sized_declarations_invalid_sizes1", 597 " Correctly reject variable declarations, having 4 dimensions, for\n" 598 " which any combination of dimensions are declared with zero-size\n" 599 " (16 cases).\n") 600 { 601 /* Left empty on purpose */ 602 } 603 ~sized_declarations_invalid_sizes1()604 virtual ~sized_declarations_invalid_sizes1() 605 { 606 /* Left empty on purpose */ 607 } 608 609 protected: 610 /* Protected methods */ 611 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 612 }; 613 614 template <class API> 615 class sized_declarations_invalid_sizes2 : public TestCaseBase<API> 616 { 617 public: 618 /* Public methods */ sized_declarations_invalid_sizes2(Context & context)619 sized_declarations_invalid_sizes2(Context& context) 620 : TestCaseBase<API>(context, "sized_declarations_invalid_sizes2", 621 " Correctly reject variable declarations, having 4 dimensions, for\n" 622 " which any combination of dimensions are declared with size -1\n" 623 " (16 cases).\n") 624 { 625 /* Left empty on purpose */ 626 } 627 ~sized_declarations_invalid_sizes2()628 virtual ~sized_declarations_invalid_sizes2() 629 { 630 /* Left empty on purpose */ 631 } 632 633 protected: 634 /* Protected methods */ 635 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 636 }; 637 638 template <class API> 639 class sized_declarations_invalid_sizes3 : public TestCaseBase<API> 640 { 641 public: 642 /* Public methods */ sized_declarations_invalid_sizes3(Context & context)643 sized_declarations_invalid_sizes3(Context& context) 644 : TestCaseBase<API>(context, "sized_declarations_invalid_sizes3", 645 " Correctly reject variable declarations, having 4 dimensions, for\n" 646 " which any combination of dimensions are declared with a\n" 647 " non-constant (16 cases).\n") 648 { 649 /* Left empty on purpose */ 650 } 651 ~sized_declarations_invalid_sizes3()652 virtual ~sized_declarations_invalid_sizes3() 653 { 654 /* Left empty on purpose */ 655 } 656 657 protected: 658 /* Protected methods */ 659 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 660 }; 661 662 template <class API> 663 class sized_declarations_invalid_sizes4 : public TestCaseBase<API> 664 { 665 public: 666 /* Public methods */ sized_declarations_invalid_sizes4(Context & context)667 sized_declarations_invalid_sizes4(Context& context) 668 : TestCaseBase<API>(context, "sized_declarations_invalid_sizes4", 669 " Correctly reject modifications of a variable declaration of\n" 670 " 4 dimensions (e.g. float x[2][2][2][2]), in which\n" 671 " each adjacent pair '][' is replaced by the sequence operator\n" 672 " (e.g. float x[2,2][2][2]) (6 cases).\n") 673 { 674 /* Left empty on purpose */ 675 } 676 ~sized_declarations_invalid_sizes4()677 virtual ~sized_declarations_invalid_sizes4() 678 { 679 /* Left empty on purpose */ 680 } 681 682 protected: 683 /* Protected methods */ 684 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 685 }; 686 687 template <class API> 688 class ConstructorsAndUnsizedDeclConstructors1 : public TestCaseBase<API> 689 { 690 public: 691 /* Public methods */ ConstructorsAndUnsizedDeclConstructors1(Context & context)692 ConstructorsAndUnsizedDeclConstructors1(Context& context) 693 : TestCaseBase<API>(context, "ConstructorsAndUnsizedDeclConstructors1", 694 " Verifies that constructors for arrays of between 2 and 8 dimensions\n" 695 " are accepted as isolated expressions for each non-opaque primitive\n" 696 " type (7 cases per primitive type).\n") 697 { 698 /* Left empty on purpose */ 699 } 700 ~ConstructorsAndUnsizedDeclConstructors1()701 virtual ~ConstructorsAndUnsizedDeclConstructors1() 702 { 703 /* Left empty on purpose */ 704 } 705 706 protected: 707 /* Protected methods */ 708 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 709 std::string recursively_initialise(std::string var_type, size_t dimension_index, std::string init_string); 710 }; 711 712 template <class API> 713 class ConstructorsAndUnsizedDeclConstructors2 : public TestCaseBase<API> 714 { 715 public: 716 /* Public methods */ ConstructorsAndUnsizedDeclConstructors2(Context & context)717 ConstructorsAndUnsizedDeclConstructors2(Context& context) 718 : TestCaseBase<API>(context, "ConstructorsAndUnsizedDeclConstructors2", 719 " Correctly reject any attempt to pass arguments to a\n" 720 " 2 dimensional float array constructor which has matching scalar\n" 721 " count, but different array shape or dimensionality to the array's\n" 722 " indexed type e.g. float[2][2](float[4](1,2,3,4)),\n" 723 " float[2][2](float[1][4](float[4](1,2,3,4))) (2 cases).\n") 724 { 725 /* Left empty on purpose */ 726 } 727 ~ConstructorsAndUnsizedDeclConstructors2()728 virtual ~ConstructorsAndUnsizedDeclConstructors2() 729 { 730 /* Left empty on purpose */ 731 } 732 733 protected: 734 /* Protected methods */ 735 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 736 }; 737 738 template <class API> 739 class ConstructorsAndUnsizedDeclUnsizedConstructors : public TestCaseBase<API> 740 { 741 public: 742 /* Public methods */ ConstructorsAndUnsizedDeclUnsizedConstructors(Context & context)743 ConstructorsAndUnsizedDeclUnsizedConstructors(Context& context) 744 : TestCaseBase<API>(context, "ConstructorsAndUnsizedDeclUnsizedConstructors", 745 " Verifies that any of the array dimensions, or any combination of\n" 746 " dimensions, may be omitted for a 4-dimensional float array\n" 747 " constructor (the sizes on its nested constructors may be\n" 748 " consistently omitted or present, and need not be manipulated\n" 749 " between cases) (e.g. float[][][2][](float[][][](float[][] etc))\n" 750 " (16 cases).\n") 751 { 752 /* Left empty on purpose */ 753 } 754 ~ConstructorsAndUnsizedDeclUnsizedConstructors()755 virtual ~ConstructorsAndUnsizedDeclUnsizedConstructors() 756 { 757 /* Left empty on purpose */ 758 } 759 760 protected: 761 /* Protected methods */ 762 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 763 }; 764 765 template <class API> 766 class ConstructorsAndUnsizedDeclConst : public TestCaseBase<API> 767 { 768 public: 769 /* Public methods */ ConstructorsAndUnsizedDeclConst(Context & context)770 ConstructorsAndUnsizedDeclConst(Context& context) 771 : TestCaseBase<API>(context, "ConstructorsAndUnsizedDeclConst", 772 " Verifies that multi-dimensional arrays can be declared as const\n" 773 " using nested constructors to initialize inner dimensions\n" 774 " e.g. const float[2][2] x = float[2][2](float[2](1,2),float[2](3,4)).\n") 775 { 776 /* Left empty on purpose */ 777 } 778 ~ConstructorsAndUnsizedDeclConst()779 virtual ~ConstructorsAndUnsizedDeclConst() 780 { 781 /* Left empty on purpose */ 782 } 783 784 protected: 785 /* Protected methods */ 786 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 787 }; 788 789 template <class API> 790 class ConstructorsAndUnsizedDeclInvalidConstructors1 : public TestCaseBase<API> 791 { 792 public: 793 /* Public methods */ ConstructorsAndUnsizedDeclInvalidConstructors1(Context & context)794 ConstructorsAndUnsizedDeclInvalidConstructors1(Context& context) 795 : TestCaseBase<API>(context, "ConstructorsAndUnsizedDeclInvalidConstructors1", 796 " Correctly reject any attempt to call array constructors for\n" 797 " 2-dimensional arrays of any opaque type.\n") 798 { 799 /* Left empty on purpose */ 800 } 801 ~ConstructorsAndUnsizedDeclInvalidConstructors1()802 virtual ~ConstructorsAndUnsizedDeclInvalidConstructors1() 803 { 804 /* Left empty on purpose */ 805 } 806 807 protected: 808 /* Protected methods */ 809 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 810 }; 811 812 template <class API> 813 class ConstructorsAndUnsizedDeclInvalidConstructors2 : public TestCaseBase<API> 814 { 815 public: 816 /* Public methods */ ConstructorsAndUnsizedDeclInvalidConstructors2(Context & context)817 ConstructorsAndUnsizedDeclInvalidConstructors2(Context& context) 818 : TestCaseBase<API>(context, "ConstructorsAndUnsizedDeclInvalidConstructors2", 819 " Correctly reject 3-dimensional int array constructor calls\n" 820 " for which any dimension or combination of dimensions is\n" 821 " given as zero (see sec(i) - 8 cases).\n") 822 { 823 /* Left empty on purpose */ 824 } 825 ~ConstructorsAndUnsizedDeclInvalidConstructors2()826 virtual ~ConstructorsAndUnsizedDeclInvalidConstructors2() 827 { 828 /* Left empty on purpose */ 829 } 830 831 protected: 832 /* Protected methods */ 833 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 834 }; 835 836 template <class API> 837 class ConstructorsAndUnsizedDeclInvalidConstructors3 : public TestCaseBase<API> 838 { 839 public: 840 /* Public methods */ ConstructorsAndUnsizedDeclInvalidConstructors3(Context & context)841 ConstructorsAndUnsizedDeclInvalidConstructors3(Context& context) 842 : TestCaseBase<API>(context, "ConstructorsAndUnsizedDeclInvalidConstructors3", 843 " Correctly reject 3-dimensional int array constructor calls\n" 844 " for which any dimension or combination of dimensions is\n" 845 " given as -1 (see sec(i) - 8 cases).\n") 846 { 847 /* Left empty on purpose */ 848 } 849 ~ConstructorsAndUnsizedDeclInvalidConstructors3()850 virtual ~ConstructorsAndUnsizedDeclInvalidConstructors3() 851 { 852 /* Left empty on purpose */ 853 } 854 855 protected: 856 /* Protected methods */ 857 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 858 }; 859 860 template <class API> 861 class ConstructorsAndUnsizedDeclInvalidConstructors4 : public TestCaseBase<API> 862 { 863 public: 864 /* Public methods */ ConstructorsAndUnsizedDeclInvalidConstructors4(Context & context)865 ConstructorsAndUnsizedDeclInvalidConstructors4(Context& context) 866 : TestCaseBase<API>(context, "ConstructorsAndUnsizedDeclInvalidConstructors4", 867 " Correctly reject 3-dimensional int array constructor calls\n" 868 " for which any dimension or combination of dimensions is\n" 869 " given by a non-constant variable (8 cases).\n") 870 { 871 /* Left empty on purpose */ 872 } 873 ~ConstructorsAndUnsizedDeclInvalidConstructors4()874 virtual ~ConstructorsAndUnsizedDeclInvalidConstructors4() 875 { 876 /* Left empty on purpose */ 877 } 878 879 protected: 880 /* Protected methods */ 881 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 882 }; 883 884 template <class API> 885 class ConstructorsAndUnsizedDeclConstructorSizing1 : public TestCaseBase<API> 886 { 887 public: 888 /* Public methods */ ConstructorsAndUnsizedDeclConstructorSizing1(Context & context)889 ConstructorsAndUnsizedDeclConstructorSizing1(Context& context) 890 : TestCaseBase<API>(context, "ConstructorsAndUnsizedDeclConstructorSizing1", 891 " Verifies that arrays of 4 dimensions can be declared with any\n" 892 " combination of dimension sizes omitted, provided a valid\n" 893 " constructor is used as an initializer (15 cases per non-opaque\n" 894 " primitive type).\n") 895 { 896 /* Left empty on purpose */ 897 } 898 ~ConstructorsAndUnsizedDeclConstructorSizing1()899 virtual ~ConstructorsAndUnsizedDeclConstructorSizing1() 900 { 901 /* Left empty on purpose */ 902 } 903 904 protected: 905 /* Protected methods */ 906 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 907 }; 908 909 template <class API> 910 class ConstructorsAndUnsizedDeclConstructorSizing2 : public TestCaseBase<API> 911 { 912 public: 913 /* Public methods */ ConstructorsAndUnsizedDeclConstructorSizing2(Context & context)914 ConstructorsAndUnsizedDeclConstructorSizing2(Context& context) 915 : TestCaseBase<API>(context, "ConstructorsAndUnsizedDeclConstructorSizing2", 916 " Verifies that a sequence of arrays from 2 to 8 dimensions can\n" 917 " be declared in a single statement\n" 918 " (e.g. float[] x=float[](4,5), y[]=float[][](float[](4)), z[][]...).\n" 919 " The size of the dimensions should vary between the cases\n" 920 " of this test (e.g. in the previous case, we have\n" 921 " float x[2] and float y[1][1]).\n") 922 { 923 /* Left empty on purpose */ 924 } 925 ~ConstructorsAndUnsizedDeclConstructorSizing2()926 virtual ~ConstructorsAndUnsizedDeclConstructorSizing2() 927 { 928 /* Left empty on purpose */ 929 } 930 931 protected: 932 /* Protected methods */ 933 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 934 }; 935 936 template <class API> 937 class ConstructorsAndUnsizedDeclStructConstructors : public TestCaseBase<API> 938 { 939 public: 940 /* Public methods */ ConstructorsAndUnsizedDeclStructConstructors(Context & context)941 ConstructorsAndUnsizedDeclStructConstructors(Context& context) 942 : TestCaseBase<API>(context, "ConstructorsAndUnsizedDeclStructConstructors", 943 " Declare a user type (struct) and verify that arrays of between 2\n" 944 " and 8 dimensions can be declared without explicit sizes, and\n" 945 " initialized from constructors (7 cases).\n") 946 { 947 /* Left empty on purpose */ 948 } 949 ~ConstructorsAndUnsizedDeclStructConstructors()950 virtual ~ConstructorsAndUnsizedDeclStructConstructors() 951 { 952 /* Left empty on purpose */ 953 } 954 955 protected: 956 /* Protected methods */ 957 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 958 std::string recursively_initialise(std::string var_type, size_t dimension_index, std::string init_string); 959 }; 960 961 template <class API> 962 class ConstructorsAndUnsizedDeclUnsizedArrays1 : public TestCaseBase<API> 963 { 964 public: 965 /* Public methods */ ConstructorsAndUnsizedDeclUnsizedArrays1(Context & context)966 ConstructorsAndUnsizedDeclUnsizedArrays1(Context& context) 967 : TestCaseBase<API>(context, "ConstructorsAndUnsizedDeclUnsizedArrays1", 968 " Correctly reject unsized declarations of variables between 2 and 8\n" 969 " dimensions for which an initializer is not present.\n") 970 { 971 /* Left empty on purpose */ 972 } 973 ~ConstructorsAndUnsizedDeclUnsizedArrays1()974 virtual ~ConstructorsAndUnsizedDeclUnsizedArrays1() 975 { 976 /* Left empty on purpose */ 977 } 978 979 protected: 980 /* Protected methods */ 981 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 982 }; 983 984 template <class API> 985 class ConstructorsAndUnsizedDeclUnsizedArrays2 : public TestCaseBase<API> 986 { 987 public: 988 /* Public methods */ ConstructorsAndUnsizedDeclUnsizedArrays2(Context & context)989 ConstructorsAndUnsizedDeclUnsizedArrays2(Context& context) 990 : TestCaseBase<API>(context, "ConstructorsAndUnsizedDeclUnsizedArrays2", 991 " Correctly reject unsized declarations where some elements are\n" 992 " lacking initializers (e.g. float[] x=float[](1), y).\n") 993 { 994 /* Left empty on purpose */ 995 } 996 ~ConstructorsAndUnsizedDeclUnsizedArrays2()997 virtual ~ConstructorsAndUnsizedDeclUnsizedArrays2() 998 { 999 /* Left empty on purpose */ 1000 } 1001 1002 protected: 1003 /* Protected methods */ 1004 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1005 }; 1006 1007 template <class API> 1008 class ConstructorsAndUnsizedDeclUnsizedArrays3 : public TestCaseBase<API> 1009 { 1010 public: 1011 /* Public methods */ ConstructorsAndUnsizedDeclUnsizedArrays3(Context & context)1012 ConstructorsAndUnsizedDeclUnsizedArrays3(Context& context) 1013 : TestCaseBase<API>(context, "ConstructorsAndUnsizedDeclUnsizedArrays3", 1014 " Correctly reject a declaration which initializes a\n" 1015 " multi-dimensional array from a matrix type,\n" 1016 " e.g. (float[][] x = mat4(0)).\n") 1017 { 1018 /* Left empty on purpose */ 1019 } 1020 ~ConstructorsAndUnsizedDeclUnsizedArrays3()1021 virtual ~ConstructorsAndUnsizedDeclUnsizedArrays3() 1022 { 1023 /* Left empty on purpose */ 1024 } 1025 1026 protected: 1027 /* Protected methods */ 1028 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1029 }; 1030 1031 template <class API> 1032 class ConstructorsAndUnsizedDeclUnsizedArrays4 : public TestCaseBase<API> 1033 { 1034 public: 1035 /* Public methods */ ConstructorsAndUnsizedDeclUnsizedArrays4(Context & context)1036 ConstructorsAndUnsizedDeclUnsizedArrays4(Context& context) 1037 : TestCaseBase<API>(context, "ConstructorsAndUnsizedDeclUnsizedArrays4", 1038 " Declare a user type containing an unsized array\n" 1039 " (e.g. struct foo { float[][] x; }) and verify that the shader is\n" 1040 " correctly rejected.\n") 1041 { 1042 /* Left empty on purpose */ 1043 } 1044 ~ConstructorsAndUnsizedDeclUnsizedArrays4()1045 virtual ~ConstructorsAndUnsizedDeclUnsizedArrays4() 1046 { 1047 /* Left empty on purpose */ 1048 } 1049 1050 protected: 1051 /* Protected methods */ 1052 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1053 }; 1054 1055 template <class API> 1056 class ExpressionsAssignment1 : public TestCaseBase<API> 1057 { 1058 public: 1059 /* Public methods */ ExpressionsAssignment1(Context & context)1060 ExpressionsAssignment1(Context& context) 1061 : TestCaseBase<API>(context, "ExpressionsAssignment1", 1062 " Declare two variables of matching array size, having between 2 and\n" 1063 " 8 dimensions, and verify that the value of one can be assigned to\n" 1064 " the other without error (7 cases).\n") 1065 { 1066 /* Left empty on purpose */ 1067 } 1068 ~ExpressionsAssignment1()1069 virtual ~ExpressionsAssignment1() 1070 { 1071 /* Left empty on purpose */ 1072 } 1073 1074 protected: 1075 /* Protected methods */ 1076 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1077 std::string recursively_initialise(std::string var_type, size_t dimension_index, std::string init_string); 1078 }; 1079 1080 template <class API> 1081 class ExpressionsAssignment2 : public TestCaseBase<API> 1082 { 1083 public: 1084 /* Public methods */ ExpressionsAssignment2(Context & context)1085 ExpressionsAssignment2(Context& context) 1086 : TestCaseBase<API>(context, "ExpressionsAssignment2", 1087 " Correctly reject assignment of variables of differing numbers of array\n" 1088 " dimensions (between 1 and 4) to one another (6 cases).\n") 1089 { 1090 /* Left empty on purpose */ 1091 } 1092 ~ExpressionsAssignment2()1093 virtual ~ExpressionsAssignment2() 1094 { 1095 /* Left empty on purpose */ 1096 } 1097 1098 protected: 1099 /* Protected methods */ 1100 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1101 }; 1102 1103 template <class API> 1104 class ExpressionsAssignment3 : public TestCaseBase<API> 1105 { 1106 public: 1107 /* Public methods */ ExpressionsAssignment3(Context & context)1108 ExpressionsAssignment3(Context& context) 1109 : TestCaseBase<API>(context, "ExpressionsAssignment3", 1110 " Correctly reject assignment of variables of 4 dimensions and differing\n" 1111 " array size to one another, where all combinations of each dimension\n" 1112 " matching or not matching are tested (15 cases).\n") 1113 { 1114 /* Left empty on purpose */ 1115 } 1116 ~ExpressionsAssignment3()1117 virtual ~ExpressionsAssignment3() 1118 { 1119 /* Left empty on purpose */ 1120 } 1121 1122 protected: 1123 /* Protected methods */ 1124 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1125 }; 1126 1127 template <class API> 1128 class ExpressionsTypeRestrictions1 : public TestCaseBase<API> 1129 { 1130 public: 1131 /* Public methods */ ExpressionsTypeRestrictions1(Context & context)1132 ExpressionsTypeRestrictions1(Context& context) 1133 : TestCaseBase<API>(context, "ExpressionsTypeRestrictions1", 1134 " Declare two 2-dimensional arrays of a sampler type and verify that\n" 1135 " one cannot be assigned to the other.\n" 1136 " Repeat the test for each opaque type.\n") 1137 { 1138 /* Left empty on purpose */ 1139 } 1140 ~ExpressionsTypeRestrictions1()1141 virtual ~ExpressionsTypeRestrictions1() 1142 { 1143 /* Left empty on purpose */ 1144 } 1145 1146 protected: 1147 /* Protected methods */ 1148 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1149 }; 1150 1151 template <class API> 1152 class ExpressionsTypeRestrictions2 : public TestCaseBase<API> 1153 { 1154 public: 1155 /* Public methods */ ExpressionsTypeRestrictions2(Context & context)1156 ExpressionsTypeRestrictions2(Context& context) 1157 : TestCaseBase<API>(context, "ExpressionsTypeRestrictions2", 1158 " For each opaque type, verify that structures containing \n" 1159 " two 2-dimensional arrays of that sampler type\n" 1160 " cannot be assigned to each other.\n") 1161 { 1162 /* Left empty on purpose */ 1163 } 1164 ~ExpressionsTypeRestrictions2()1165 virtual ~ExpressionsTypeRestrictions2() 1166 { 1167 /* Left empty on purpose */ 1168 } 1169 1170 protected: 1171 /* Protected methods */ 1172 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1173 }; 1174 1175 template <class API> 1176 class ExpressionsIndexingScalar1 : public TestCaseBase<API> 1177 { 1178 public: 1179 /* Public methods */ ExpressionsIndexingScalar1(Context & context)1180 ExpressionsIndexingScalar1(Context& context) 1181 : TestCaseBase<API>(context, "ExpressionsIndexingScalar1", 1182 " Assign to each scalar element of a 4 dimensional array\n" 1183 " float x[1][2][3][4] (24 cases).\n") 1184 { 1185 /* Left empty on purpose */ 1186 } 1187 ~ExpressionsIndexingScalar1()1188 virtual ~ExpressionsIndexingScalar1() 1189 { 1190 /* Left empty on purpose */ 1191 } 1192 1193 protected: 1194 /* Protected methods */ 1195 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1196 }; 1197 1198 template <class API> 1199 class ExpressionsIndexingScalar2 : public TestCaseBase<API> 1200 { 1201 public: 1202 /* Public methods */ ExpressionsIndexingScalar2(Context & context)1203 ExpressionsIndexingScalar2(Context& context) 1204 : TestCaseBase<API>(context, "ExpressionsIndexingScalar2", 1205 " Correctly reject indexing the array with any combination\n" 1206 " of indices given as -1 (15 cases).\n") 1207 { 1208 /* Left empty on purpose */ 1209 } 1210 ~ExpressionsIndexingScalar2()1211 virtual ~ExpressionsIndexingScalar2() 1212 { 1213 /* Left empty on purpose */ 1214 } 1215 1216 protected: 1217 /* Protected methods */ 1218 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1219 }; 1220 1221 template <class API> 1222 class ExpressionsIndexingScalar3 : public TestCaseBase<API> 1223 { 1224 public: 1225 /* Public methods */ ExpressionsIndexingScalar3(Context & context)1226 ExpressionsIndexingScalar3(Context& context) 1227 : TestCaseBase<API>(context, "ExpressionsIndexingScalar3", 1228 " Correctly reject indexing the array with any combination\n" 1229 " of indices given as 4 (15 cases).\n") 1230 { 1231 /* Left empty on purpose */ 1232 } 1233 ~ExpressionsIndexingScalar3()1234 virtual ~ExpressionsIndexingScalar3() 1235 { 1236 /* Left empty on purpose */ 1237 } 1238 1239 protected: 1240 /* Protected methods */ 1241 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1242 }; 1243 1244 template <class API> 1245 class ExpressionsIndexingScalar4 : public TestCaseBase<API> 1246 { 1247 public: 1248 /* Public methods */ ExpressionsIndexingScalar4(Context & context)1249 ExpressionsIndexingScalar4(Context& context) 1250 : TestCaseBase<API>(context, "ExpressionsIndexingScalar4", 1251 " Correctly reject any attempt to index a 4-dimensional array with\n" 1252 " any combination of missing array index expressions\n" 1253 " (e.g. x[][0][0][]) - (15 cases).\n") 1254 { 1255 /* Left empty on purpose */ 1256 } 1257 ~ExpressionsIndexingScalar4()1258 virtual ~ExpressionsIndexingScalar4() 1259 { 1260 /* Left empty on purpose */ 1261 } 1262 1263 protected: 1264 /* Protected methods */ 1265 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1266 }; 1267 1268 template <class API> 1269 class ExpressionsIndexingArray1 : public TestCaseBase<API> 1270 { 1271 public: 1272 /* Public methods */ ExpressionsIndexingArray1(Context & context)1273 ExpressionsIndexingArray1(Context& context) 1274 : TestCaseBase<API>(context, "ExpressionsIndexingArray1", 1275 " Assign to each dimension of an 8 dimensional, single-element array\n" 1276 " with an appropriate constructor (e.g. float\n" 1277 " x[1][1][1][1][1][1][1][1];\n" 1278 " x[0] = float[1][1][1][1][1][1][1](1);\n" 1279 " x[0][0] = etc) - (8 cases).\n") 1280 { 1281 /* Left empty on purpose */ 1282 } 1283 ~ExpressionsIndexingArray1()1284 virtual ~ExpressionsIndexingArray1() 1285 { 1286 /* Left empty on purpose */ 1287 } 1288 1289 protected: 1290 /* Protected methods */ 1291 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1292 }; 1293 1294 template <class API> 1295 class ExpressionsIndexingArray2 : public TestCaseBase<API> 1296 { 1297 public: 1298 /* Public methods */ ExpressionsIndexingArray2(Context & context)1299 ExpressionsIndexingArray2(Context& context) 1300 : TestCaseBase<API>(context, "ExpressionsIndexingArray2", 1301 " Declare two 8 dimensional, single-element arrays, and assign to\n" 1302 " each dimension of one from the matching sub_scripting of the other\n" 1303 " (e.g. x[0] = y[0]; x[0][0] = y[0][0]; etc.) (8 cases).\n") 1304 { 1305 /* Left empty on purpose */ 1306 } 1307 ~ExpressionsIndexingArray2()1308 virtual ~ExpressionsIndexingArray2() 1309 { 1310 /* Left empty on purpose */ 1311 } 1312 1313 protected: 1314 /* Protected methods */ 1315 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1316 std::string recursively_initialise(std::string var_type, size_t dimension_index, std::string init_string); 1317 }; 1318 1319 template <class API> 1320 class ExpressionsIndexingArray3 : public TestCaseBase<API> 1321 { 1322 public: 1323 /* Public methods */ ExpressionsIndexingArray3(Context & context)1324 ExpressionsIndexingArray3(Context& context) 1325 : TestCaseBase<API>(context, "ExpressionsIndexingArray3", 1326 " Correctly reject use of ivecn to index an n-dimensional array -\n" 1327 " e.g. float x[2][2][2][2]; x[ivec4(0)] = 1; (3 cases).\n") 1328 { 1329 /* Left empty on purpose */ 1330 } 1331 ~ExpressionsIndexingArray3()1332 virtual ~ExpressionsIndexingArray3() 1333 { 1334 /* Left empty on purpose */ 1335 } 1336 1337 protected: 1338 /* Protected methods */ 1339 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1340 }; 1341 1342 template <class API> 1343 class ExpressionsDynamicIndexing1 : public TestCaseBase<API> 1344 { 1345 public: 1346 /* Public methods */ ExpressionsDynamicIndexing1(Context & context)1347 ExpressionsDynamicIndexing1(Context& context) 1348 : TestCaseBase<API>(context, "ExpressionsDynamicIndexing1", 1349 " Verifies that any mixture of constant, uniform and dynamic expressions\n" 1350 " can be used as the array index expression, in any combination, for\n" 1351 " each dimension of a 2 dimensional array (16 cases).\n") 1352 { 1353 /* Left empty on purpose */ 1354 } 1355 ~ExpressionsDynamicIndexing1()1356 virtual ~ExpressionsDynamicIndexing1() 1357 { 1358 /* Left empty on purpose */ 1359 } 1360 1361 protected: 1362 /* Protected methods */ 1363 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1364 }; 1365 1366 template <class API> 1367 class ExpressionsDynamicIndexing2 : public TestCaseBase<API> 1368 { 1369 public: 1370 /* Public methods */ ExpressionsDynamicIndexing2(Context & context)1371 ExpressionsDynamicIndexing2(Context& context) 1372 : TestCaseBase<API>(context, "ExpressionsDynamicIndexing2", 1373 " Correctly reject any attempt to index 4-dimensional arrays of opaque\n" 1374 " types with any combination of non-constant expressions\n" 1375 " (e.g. x[0][y][0][y] etc for non-const y) - (15 cases per type).\n") 1376 { 1377 /* Left empty on purpose */ 1378 } 1379 ~ExpressionsDynamicIndexing2()1380 virtual ~ExpressionsDynamicIndexing2() 1381 { 1382 /* Left empty on purpose */ 1383 } 1384 1385 protected: 1386 /* Protected methods */ 1387 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1388 }; 1389 1390 template <class API> 1391 class ExpressionsEquality1 : public TestCaseBase<API> 1392 { 1393 public: 1394 /* Public methods */ ExpressionsEquality1(Context & context)1395 ExpressionsEquality1(Context& context) 1396 : TestCaseBase<API>(context, "ExpressionsEquality1", 1397 " Verifies that two 4-dimensional arrays of matching primitive\n" 1398 " type can be correctly compared for equality and inequality, when\n" 1399 " they differ independently in each component or combination of\n" 1400 " components (e.g. x = float[][](float[](1,1), float[](1,1)); y =\n" 1401 " float[][](float[](2,1), float[](1,1)); return x == y;) - (16\n" 1402 " cases per primitive type).\n") 1403 { 1404 /* Left empty on purpose */ 1405 } 1406 ~ExpressionsEquality1()1407 virtual ~ExpressionsEquality1() 1408 { 1409 /* Left empty on purpose */ 1410 } 1411 1412 protected: 1413 /* Protected methods */ 1414 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1415 }; 1416 1417 template <class API> 1418 class ExpressionsEquality2 : public TestCaseBase<API> 1419 { 1420 public: 1421 /* Public methods */ ExpressionsEquality2(Context & context)1422 ExpressionsEquality2(Context& context) 1423 : TestCaseBase<API>(context, "ExpressionsEquality2", 1424 " Verifies that two 4-dimensional arrays of matching user (struct)\n" 1425 " types can be correctly compared for equality and inequality, when\n" 1426 " they differ independently in each component or combination of\n" 1427 " components - (16 cases per primitive type).\n") 1428 { 1429 /* Left empty on purpose */ 1430 } 1431 ~ExpressionsEquality2()1432 virtual ~ExpressionsEquality2() 1433 { 1434 /* Left empty on purpose */ 1435 } 1436 1437 protected: 1438 /* Protected methods */ 1439 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1440 }; 1441 1442 template <class API> 1443 class ExpressionsLength1 : public TestCaseBase<API> 1444 { 1445 public: 1446 /* Public methods */ ExpressionsLength1(Context & context,const glw::GLchar * name,const glw::GLchar * description)1447 ExpressionsLength1(Context& context, const glw::GLchar* name, const glw::GLchar* description) 1448 : TestCaseBase<API>(context, name, description) 1449 { 1450 /* Left empty on purpose */ 1451 } 1452 ExpressionsLength1(Context & context)1453 ExpressionsLength1(Context& context) 1454 : TestCaseBase<API>(context, "ExpressionsLength1", 1455 " For a 4-dimensional array declared as int x[4][3][2][1], verify that\n" 1456 " x.length returns the integer 4, x[0].length the integer 3, and so\n" 1457 " forth (4 cases).\n") 1458 { 1459 /* Left empty on purpose */ 1460 } 1461 ~ExpressionsLength1()1462 virtual ~ExpressionsLength1() 1463 { 1464 /* Left empty on purpose */ 1465 } 1466 1467 protected: 1468 /* Protected methods */ 1469 void execute_dispatch_test(typename TestCaseBase<API>::TestShaderType tested_shader_type, 1470 const std::string& tested_declaration, const std::string& tested_snippet); 1471 1472 void execute_draw_test(typename TestCaseBase<API>::TestShaderType tested_shader_type, 1473 const std::string& tested_declaration, const std::string& tested_snippet); 1474 1475 std::string prepare_compute_shader(typename TestCaseBase<API>::TestShaderType tested_shader_type, 1476 const std::string& tested_declaration, const std::string& tested_snippet); 1477 1478 std::string prepare_fragment_shader(typename TestCaseBase<API>::TestShaderType tested_shader_type, 1479 const std::string& tested_declaration, const std::string& tested_snippet); 1480 1481 std::string prepare_geometry_shader(typename TestCaseBase<API>::TestShaderType tested_shader_type, 1482 const std::string& tested_declaration, const std::string& tested_snippet); 1483 1484 std::string prepare_tess_ctrl_shader(typename TestCaseBase<API>::TestShaderType tested_shader_type, 1485 const std::string& tested_declaration, const std::string& tested_snippet); 1486 1487 std::string prepare_tess_eval_shader(typename TestCaseBase<API>::TestShaderType tested_shader_type, 1488 const std::string& tested_declaration, const std::string& tested_snippet); 1489 1490 std::string prepare_vertex_shader(typename TestCaseBase<API>::TestShaderType tested_shader_type, 1491 const std::string& tested_declaration, const std::string& tested_snippet); 1492 1493 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1494 }; 1495 1496 template <class API> 1497 class ExpressionsLength2 : public ExpressionsLength1<API> 1498 { 1499 public: 1500 /* Public methods */ ExpressionsLength2(Context & context)1501 ExpressionsLength2(Context& context) 1502 : ExpressionsLength1<API>(context, "ExpressionsLength2", 1503 " For a 4-dimensional array declared as int x[1][2][3][4], verify that\n" 1504 " x.length returns the integer 1, x[0].length the integer 2, and so\n" 1505 " forth (4 cases).\n") 1506 { 1507 /* Left empty on purpose */ 1508 } 1509 ~ExpressionsLength2()1510 virtual ~ExpressionsLength2() 1511 { 1512 /* Left empty on purpose */ 1513 } 1514 1515 protected: 1516 /* Protected methods */ 1517 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1518 }; 1519 1520 template <class API> 1521 class ExpressionsLength3 : public ExpressionsLength1<API> 1522 { 1523 public: 1524 /* Public methods */ ExpressionsLength3(Context & context)1525 ExpressionsLength3(Context& context) 1526 : ExpressionsLength1<API>(context, "ExpressionsLength3", 1527 " Correctly reject any use of the length method on elements of a\n" 1528 " 4-dimensional array x[1][1][1][1] for which the index\n" 1529 " expression is omitted, e.g. x[].length, x[][].length etc (3 cases).\n") 1530 { 1531 /* Left empty on purpose */ 1532 } 1533 ~ExpressionsLength3()1534 virtual ~ExpressionsLength3() 1535 { 1536 /* Left empty on purpose */ 1537 } 1538 1539 protected: 1540 /* Protected methods */ 1541 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1542 }; 1543 1544 template <class API> 1545 class ExpressionsInvalid1 : public TestCaseBase<API> 1546 { 1547 public: 1548 /* Public methods */ ExpressionsInvalid1(Context & context)1549 ExpressionsInvalid1(Context& context) 1550 : TestCaseBase<API>(context, "ExpressionsInvalid1", " Correctly reject an assignment of a 2 dimensional\n" 1551 " array x[2][2] to a variable y of type mat2.\n") 1552 { 1553 /* Left empty on purpose */ 1554 } 1555 ~ExpressionsInvalid1()1556 virtual ~ExpressionsInvalid1() 1557 { 1558 /* Left empty on purpose */ 1559 } 1560 1561 protected: 1562 /* Protected methods */ 1563 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1564 }; 1565 1566 template <class API> 1567 class ExpressionsInvalid2 : public TestCaseBase<API> 1568 { 1569 public: 1570 /* Public methods */ ExpressionsInvalid2(Context & context)1571 ExpressionsInvalid2(Context& context) 1572 : TestCaseBase<API>(context, "ExpressionsInvalid2", 1573 " For 8-dimensional arrays x,y, correctly reject any attempt\n" 1574 " to apply the relational operators other than equality and\n" 1575 " inequality (4 cases per non-opaque primitive type).\n") 1576 { 1577 /* Left empty on purpose */ 1578 } 1579 ~ExpressionsInvalid2()1580 virtual ~ExpressionsInvalid2() 1581 { 1582 /* Left empty on purpose */ 1583 } 1584 1585 protected: 1586 /* Protected methods */ 1587 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1588 }; 1589 1590 template <class API> 1591 class InteractionFunctionCalls1 : public TestCaseBase<API> 1592 { 1593 public: 1594 /* Public methods */ InteractionFunctionCalls1(Context & context,const glw::GLchar * name,const glw::GLchar * description)1595 InteractionFunctionCalls1(Context& context, const glw::GLchar* name, const glw::GLchar* description) 1596 : TestCaseBase<API>(context, name, description) 1597 { 1598 /* Left empty on purpose */ 1599 } 1600 InteractionFunctionCalls1(Context & context)1601 InteractionFunctionCalls1(Context& context) 1602 : TestCaseBase<API>(context, "InteractionFunctionCalls1", 1603 " Declare a function returning an 8-dimensional 64-element array as\n" 1604 " an out parameter, which places a unique integer in each\n" 1605 " element.\n" 1606 " Verifies that the values are returned as expected when this function\n" 1607 " is called.\n" 1608 " Repeat for the following primitive types: int, float,\n" 1609 " ivec2, ivec3, ivec4, vec2, vec3, vec4, mat2, mat3, mat4.\n") 1610 { 1611 /* Left empty on purpose */ 1612 } 1613 ~InteractionFunctionCalls1()1614 virtual ~InteractionFunctionCalls1() 1615 { 1616 /* Left empty on purpose */ 1617 } 1618 1619 protected: 1620 /* Protected methods */ 1621 void execute_dispatch_test(typename TestCaseBase<API>::TestShaderType tested_shader_type, 1622 const std::string& function_definition, const std::string& function_use, 1623 const std::string& verification); 1624 1625 void execute_draw_test(typename TestCaseBase<API>::TestShaderType tested_shader_type, 1626 const std::string& function_definition, const std::string& function_use, 1627 const std::string& verification); 1628 1629 std::string prepare_compute_shader(typename TestCaseBase<API>::TestShaderType tested_shader_type, 1630 const std::string& function_definition, const std::string& function_use, 1631 const std::string& verification); 1632 1633 std::string prepare_fragment_shader(typename TestCaseBase<API>::TestShaderType tested_shader_type, 1634 const std::string& function_definition, const std::string& function_use, 1635 const std::string& verification); 1636 1637 std::string prepare_geometry_shader(typename TestCaseBase<API>::TestShaderType tested_shader_type, 1638 const std::string& function_definition, const std::string& function_use, 1639 const std::string& verification); 1640 1641 std::string prepare_tess_ctrl_shader(typename TestCaseBase<API>::TestShaderType tested_shader_type, 1642 const std::string& function_definition, const std::string& function_use, 1643 const std::string& verification); 1644 1645 std::string prepare_tess_eval_shader(typename TestCaseBase<API>::TestShaderType tested_shader_type, 1646 const std::string& function_definition, const std::string& function_use, 1647 const std::string& verification); 1648 1649 std::string prepare_vertex_shader(typename TestCaseBase<API>::TestShaderType tested_shader_type, 1650 const std::string& function_definition, const std::string& function_use, 1651 const std::string& verification); 1652 1653 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1654 }; 1655 1656 template <class API> 1657 class InteractionFunctionCalls2 : public InteractionFunctionCalls1<API> 1658 { 1659 public: 1660 /* Public methods */ InteractionFunctionCalls2(Context & context)1661 InteractionFunctionCalls2(Context& context) 1662 : InteractionFunctionCalls1<API>(context, "InteractionFunctionCalls2", 1663 " Declare a function taking an inout parameter,\n" 1664 " which multiplies each element by a different prime.\n" 1665 " Verifies that the results after returning are again as expected.\n" 1666 " Repeat for the following primitive types: int, float,\n" 1667 " ivec2, ivec3, ivec4, vec2, vec3, vec4, mat2, mat3, mat4.\n") 1668 { 1669 /* Left empty on purpose */ 1670 } 1671 ~InteractionFunctionCalls2()1672 virtual ~InteractionFunctionCalls2() 1673 { 1674 /* Left empty on purpose */ 1675 } 1676 1677 protected: 1678 /* Protected methods */ 1679 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1680 }; 1681 1682 template <class API> 1683 class InteractionArgumentAliasing1 : public InteractionFunctionCalls1<API> 1684 { 1685 public: 1686 /* Public methods */ InteractionArgumentAliasing1(Context & context)1687 InteractionArgumentAliasing1(Context& context) 1688 : InteractionFunctionCalls1<API>(context, "InteractionArgumentAliasing1", 1689 " Declare a function taking two 8-dimensional, 64-element parameters\n" 1690 " (e.g. void g(int x[2][2][2][2][2][2][2][2], int\n" 1691 " y[2][2][2][2][2][2][2][2]) and verify that after calling g(z,z),\n" 1692 " and overwriting x with a constant value, the original values of z\n" 1693 " are accessible through y.\n" 1694 " Repeat for float and mat4 types.\n") 1695 { 1696 /* Left empty on purpose */ 1697 } 1698 ~InteractionArgumentAliasing1()1699 virtual ~InteractionArgumentAliasing1() 1700 { 1701 /* Left empty on purpose */ 1702 } 1703 1704 protected: 1705 /* Protected methods */ 1706 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1707 }; 1708 1709 template <class API> 1710 class InteractionArgumentAliasing2 : public InteractionFunctionCalls1<API> 1711 { 1712 public: 1713 /* Public methods */ InteractionArgumentAliasing2(Context & context)1714 InteractionArgumentAliasing2(Context& context) 1715 : InteractionFunctionCalls1<API>(context, "InteractionArgumentAliasing2", 1716 " Declare a function taking two 8-dimensional, 64-element parameters\n" 1717 " (e.g. void g(int x[2][2][2][2][2][2][2][2], int\n" 1718 " y[2][2][2][2][2][2][2][2]) and verify that after calling g(z,z),\n" 1719 " and overwriting y with a constant value, the original values of z\n" 1720 " are accessible through x.\n" 1721 " Repeat for float and mat4 types.\n") 1722 { 1723 /* Left empty on purpose */ 1724 } 1725 ~InteractionArgumentAliasing2()1726 virtual ~InteractionArgumentAliasing2() 1727 { 1728 /* Left empty on purpose */ 1729 } 1730 1731 protected: 1732 /* Protected methods */ 1733 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1734 }; 1735 1736 template <class API> 1737 class InteractionArgumentAliasing3 : public InteractionFunctionCalls1<API> 1738 { 1739 public: 1740 /* Public methods */ InteractionArgumentAliasing3(Context & context)1741 InteractionArgumentAliasing3(Context& context) 1742 : InteractionFunctionCalls1<API>(context, "InteractionArgumentAliasing3", 1743 " Declare a function taking two 8-dimensional, 64-element parameters\n" 1744 " (e.g. void g(int x[2][2][2][2][2][2][2][2], int\n" 1745 " y[2][2][2][2][2][2][2][2]) and verify that after calling g(z,z),\n" 1746 " and overwriting y with a constant value, the original values of z\n" 1747 " are accessible through x, where x is an out parameter.\n" 1748 " Repeat for float and mat4 types.\n") 1749 { 1750 /* Left empty on purpose */ 1751 } 1752 ~InteractionArgumentAliasing3()1753 virtual ~InteractionArgumentAliasing3() 1754 { 1755 /* Left empty on purpose */ 1756 } 1757 1758 protected: 1759 /* Protected methods */ 1760 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1761 }; 1762 1763 template <class API> 1764 class InteractionArgumentAliasing4 : public InteractionFunctionCalls1<API> 1765 { 1766 public: 1767 /* Public methods */ InteractionArgumentAliasing4(Context & context)1768 InteractionArgumentAliasing4(Context& context) 1769 : InteractionFunctionCalls1<API>(context, "InteractionArgumentAliasing4", 1770 " Declare a function taking two 8-dimensional, 64-element parameters\n" 1771 " (e.g. void g(int x[2][2][2][2][2][2][2][2], int\n" 1772 " y[2][2][2][2][2][2][2][2]) and verify that after calling g(z,z),\n" 1773 " and overwriting x with a constant value, the original values of z\n" 1774 " are accessible through y, where y is an out parameter.\n" 1775 " Repeat for float and mat4 types.\n") 1776 { 1777 /* Left empty on purpose */ 1778 } 1779 ~InteractionArgumentAliasing4()1780 virtual ~InteractionArgumentAliasing4() 1781 { 1782 /* Left empty on purpose */ 1783 } 1784 1785 protected: 1786 /* Protected methods */ 1787 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1788 }; 1789 1790 template <class API> 1791 class InteractionArgumentAliasing5 : public InteractionFunctionCalls1<API> 1792 { 1793 public: 1794 /* Public methods */ InteractionArgumentAliasing5(Context & context)1795 InteractionArgumentAliasing5(Context& context) 1796 : InteractionFunctionCalls1<API>(context, "InteractionArgumentAliasing5", 1797 " Declare a function taking two 8-dimensional, 64-element parameters\n" 1798 " (e.g. void g(int x[2][2][2][2][2][2][2][2], int\n" 1799 " y[2][2][2][2][2][2][2][2]) and verify that after calling g(z,z),\n" 1800 " and overwriting y with a constant value, the original values of z\n" 1801 " are accessible through x, where x is an inout parameter.\n" 1802 " Repeat for float and mat4 types.\n") 1803 { 1804 /* Left empty on purpose */ 1805 } 1806 ~InteractionArgumentAliasing5()1807 virtual ~InteractionArgumentAliasing5() 1808 { 1809 /* Left empty on purpose */ 1810 } 1811 1812 protected: 1813 /* Protected methods */ 1814 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1815 }; 1816 1817 template <class API> 1818 class InteractionArgumentAliasing6 : public InteractionFunctionCalls1<API> 1819 { 1820 public: 1821 /* Public methods */ InteractionArgumentAliasing6(Context & context)1822 InteractionArgumentAliasing6(Context& context) 1823 : InteractionFunctionCalls1<API>(context, "InteractionArgumentAliasing6", 1824 " Declare a function taking two 8-dimensional, 64-element parameters\n" 1825 " (e.g. void g(int x[2][2][2][2][2][2][2][2], int\n" 1826 " y[2][2][2][2][2][2][2][2]) and verify that after calling g(z,z),\n" 1827 " and overwriting x with a constant value, the original values of z\n" 1828 " are accessible through y, where y is an inout parameter.\n" 1829 " Repeat for float and mat4 types.\n") 1830 { 1831 /* Left empty on purpose */ 1832 } 1833 ~InteractionArgumentAliasing6()1834 virtual ~InteractionArgumentAliasing6() 1835 { 1836 /* Left empty on purpose */ 1837 } 1838 1839 public: 1840 //AL protected: 1841 /* Protected methods */ 1842 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1843 }; 1844 1845 template <class API> 1846 class InteractionUniforms1 : public TestCaseBase<API> 1847 { 1848 public: 1849 /* Public methods */ InteractionUniforms1(Context & context,const glw::GLchar * name,const glw::GLchar * description)1850 InteractionUniforms1(Context& context, const glw::GLchar* name, const glw::GLchar* description) 1851 : TestCaseBase<API>(context, name, description) 1852 { 1853 /* Left empty on purpose */ 1854 } 1855 InteractionUniforms1(Context & context)1856 InteractionUniforms1(Context& context) 1857 : TestCaseBase<API>(context, "InteractionUniforms1", 1858 " Declare a 4-dimensional uniform array and verify that it can be\n" 1859 " initialized with user data correctly using the API.\n") 1860 { 1861 /* Left empty on purpose */ 1862 } 1863 ~InteractionUniforms1()1864 virtual ~InteractionUniforms1() 1865 { 1866 /* Left empty on purpose */ 1867 } 1868 1869 protected: 1870 /* Protected methods */ 1871 std::string prepare_compute_shader(typename TestCaseBase<API>::TestShaderType tested_shader_type, 1872 const std::string& uniform_definition, const std::string& uniform_use); 1873 1874 std::string prepare_fragment_shader(typename TestCaseBase<API>::TestShaderType tested_shader_type, 1875 const std::string& uniform_definition, const std::string& uniform_use); 1876 1877 std::string prepare_geometry_shader(typename TestCaseBase<API>::TestShaderType tested_shader_type, 1878 const std::string& uniform_definition, const std::string& uniform_use); 1879 1880 std::string prepare_tess_ctrl_shader(typename TestCaseBase<API>::TestShaderType tested_shader_type, 1881 const std::string& uniform_definition, const std::string& uniform_use); 1882 1883 std::string prepare_tess_eval_shader(typename TestCaseBase<API>::TestShaderType tested_shader_type, 1884 const std::string& uniform_definition, const std::string& uniform_use); 1885 1886 std::string prepare_vertex_shader(typename TestCaseBase<API>::TestShaderType tested_shader_type, 1887 const std::string& uniform_definition, const std::string& uniform_use); 1888 1889 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1890 }; 1891 1892 template <class API> 1893 class InteractionUniforms2 : public TestCaseBase<API> 1894 { 1895 public: 1896 /* Public methods */ InteractionUniforms2(Context & context)1897 InteractionUniforms2(Context& context) 1898 : TestCaseBase<API>(context, "InteractionUniforms2", 1899 " Correctly reject 4-dimensional uniform arrays with any unsized\n" 1900 " dimension, with or without an initializer (30 cases).\n") 1901 { 1902 /* Left empty on purpose */ 1903 } 1904 ~InteractionUniforms2()1905 virtual ~InteractionUniforms2() 1906 { 1907 /* Left empty on purpose */ 1908 } 1909 1910 protected: 1911 /* Protected methods */ 1912 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1913 }; 1914 1915 template <class API> 1916 class InteractionUniformBuffers1 : public TestCaseBase<API> 1917 { 1918 public: 1919 /* Public methods */ InteractionUniformBuffers1(Context & context)1920 InteractionUniformBuffers1(Context& context) 1921 : TestCaseBase<API>(context, "InteractionUniformBuffers1", 1922 " Declare a uniform block containing a 6-dimensional array and verify\n" 1923 " that the resulting shader compiles.\n" 1924 " Repeat for ints and uints.\n") 1925 { 1926 /* Left empty on purpose */ 1927 } 1928 ~InteractionUniformBuffers1()1929 virtual ~InteractionUniformBuffers1() 1930 { 1931 /* Left empty on purpose */ 1932 } 1933 1934 protected: 1935 /* Protected methods */ 1936 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1937 }; 1938 1939 template <class API> 1940 class InteractionUniformBuffers2 : public InteractionUniforms1<API> 1941 { 1942 public: 1943 /* Public methods */ InteractionUniformBuffers2(Context & context)1944 InteractionUniformBuffers2(Context& context) 1945 : InteractionUniforms1<API>(context, "InteractionUniformBuffers2", 1946 " Declare a 4-dimensional uniform float array x[2][2][2][2] within a\n" 1947 " uniform block, and verify that it can be initialized correctly with user\n" 1948 " data via the API.\n" 1949 " Repeat for ints and uints.\n") 1950 { 1951 /* Left empty on purpose */ 1952 } 1953 ~InteractionUniformBuffers2()1954 virtual ~InteractionUniformBuffers2() 1955 { 1956 /* Left empty on purpose */ 1957 } 1958 1959 protected: 1960 /* Protected methods */ 1961 void execute_dispatch_test(); 1962 1963 void execute_draw_test(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1964 1965 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1966 }; 1967 1968 template <class API> 1969 class InteractionUniformBuffers3 : public TestCaseBase<API> 1970 { 1971 public: 1972 /* Public methods */ InteractionUniformBuffers3(Context & context)1973 InteractionUniformBuffers3(Context& context) 1974 : TestCaseBase<API>(context, "InteractionUniformBuffers3", 1975 " Correctly reject 4-dimensional uniform arrays with a uniform block\n" 1976 " with any dimension unsized, with or without an initializer (30 cases).\n" 1977 " Repeat for ints and uints.\n") 1978 { 1979 /* Left empty on purpose */ 1980 } 1981 ~InteractionUniformBuffers3()1982 virtual ~InteractionUniformBuffers3() 1983 { 1984 /* Left empty on purpose */ 1985 } 1986 1987 protected: 1988 /* Protected methods */ 1989 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 1990 }; 1991 1992 template <class API> 1993 class InteractionStorageBuffers1 : public TestCaseBase<API> 1994 { 1995 public: 1996 /* Public methods */ InteractionStorageBuffers1(Context & context)1997 InteractionStorageBuffers1(Context& context) 1998 : TestCaseBase<API>(context, "InteractionStorageBuffers1", 1999 " Declare a storage block containing a 6-dimensional array and verify\n" 2000 " that the resulting shader compiles.\n" 2001 " Repeat for ints and uints.\n") 2002 { 2003 /* Left empty on purpose */ 2004 } 2005 ~InteractionStorageBuffers1()2006 virtual ~InteractionStorageBuffers1() 2007 { 2008 /* Left empty on purpose */ 2009 } 2010 2011 protected: 2012 /* Protected methods */ 2013 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 2014 }; 2015 2016 template <class API> 2017 class InteractionStorageBuffers2 : public InteractionUniforms1<API> 2018 { 2019 public: 2020 /* Public methods */ InteractionStorageBuffers2(Context & context)2021 InteractionStorageBuffers2(Context& context) 2022 : InteractionUniforms1<API>(context, "InteractionStorageBuffers2", 2023 " Declare a 4-dimensional float array x[2][2][2][2] within a\n" 2024 " storage block, and verify that it can be initialized correctly with user\n" 2025 " data via the API.\n" 2026 " Repeat for ints and uints.\n") 2027 { 2028 /* Left empty on purpose */ 2029 } 2030 ~InteractionStorageBuffers2()2031 virtual ~InteractionStorageBuffers2() 2032 { 2033 /* Left empty on purpose */ 2034 } 2035 2036 protected: 2037 /* Protected methods */ 2038 void execute_dispatch_test(); 2039 2040 void execute_draw_test(typename TestCaseBase<API>::TestShaderType tested_shader_type); 2041 2042 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 2043 }; 2044 2045 template <class API> 2046 class InteractionStorageBuffers3 : public TestCaseBase<API> 2047 { 2048 public: 2049 /* Public methods */ InteractionStorageBuffers3(Context & context)2050 InteractionStorageBuffers3(Context& context) 2051 : TestCaseBase<API>(context, "InteractionStorageBuffers3", 2052 " Correctly reject 4-dimensional uniform arrays with a uniform block\n" 2053 " with any dimension unsized, with or without an initializer (30 cases).\n" 2054 " Repeat for ints and uints.\n") 2055 { 2056 /* Left empty on purpose */ 2057 } 2058 ~InteractionStorageBuffers3()2059 virtual ~InteractionStorageBuffers3() 2060 { 2061 /* Left empty on purpose */ 2062 } 2063 2064 protected: 2065 /* Protected methods */ 2066 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 2067 }; 2068 2069 template <class API> 2070 class InteractionInterfaceArrays1 : public TestCaseBase<API> 2071 { 2072 public: 2073 /* Public methods */ InteractionInterfaceArrays1(Context & context)2074 InteractionInterfaceArrays1(Context& context) 2075 : TestCaseBase<API>(context, "InteractionInterfaceArrays1", " Verifies that 2-dimensional arrays of shader\n" 2076 " storage buffer objects are correctly rejected.\n") 2077 { 2078 /* Left empty on purpose */ 2079 } 2080 ~InteractionInterfaceArrays1()2081 virtual ~InteractionInterfaceArrays1() 2082 { 2083 /* Left empty on purpose */ 2084 } 2085 2086 protected: 2087 /* Protected methods */ 2088 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 2089 }; 2090 2091 template <class API> 2092 class InteractionInterfaceArrays2 : public TestCaseBase<API> 2093 { 2094 public: 2095 /* Public methods */ InteractionInterfaceArrays2(Context & context,const glw::GLchar * name,const glw::GLchar * description)2096 InteractionInterfaceArrays2(Context& context, const glw::GLchar* name, const glw::GLchar* description) 2097 : TestCaseBase<API>(context, name, description) 2098 { 2099 /* Left empty on purpose */ 2100 } 2101 InteractionInterfaceArrays2(Context & context)2102 InteractionInterfaceArrays2(Context& context) 2103 : TestCaseBase<API>(context, "InteractionInterfaceArrays2", 2104 " Verifies that 2-dimensional arrays of input and output variables\n" 2105 " are correctly rejected.\n") 2106 { 2107 /* Left empty on purpose */ 2108 } 2109 ~InteractionInterfaceArrays2()2110 virtual ~InteractionInterfaceArrays2() 2111 { 2112 /* Left empty on purpose */ 2113 } 2114 2115 protected: 2116 /* Protected methods */ 2117 const typename TestCaseBase<API>::TestShaderType get_output_shader_type( 2118 const typename TestCaseBase<API>::TestShaderType& input_shader_type); 2119 const std::string prepare_fragment_shader(const typename TestCaseBase<API>::TestShaderType& input_shader_type, 2120 const std::string& input_source, const std::string& output_source); 2121 const std::string prepare_geometry_shader(const typename TestCaseBase<API>::TestShaderType& input_shader_type, 2122 const std::string& input_source, const std::string& output_source); 2123 const std::string prepare_tess_ctrl_shader_source( 2124 const typename TestCaseBase<API>::TestShaderType& input_shader_type, const std::string& input_source, 2125 const std::string& output_source); 2126 const std::string prepare_tess_eval_shader_source( 2127 const typename TestCaseBase<API>::TestShaderType& input_shader_type, const std::string& input_source, 2128 const std::string& output_source); 2129 const std::string prepare_vertex_shader(const typename TestCaseBase<API>::TestShaderType& input_shader_type, 2130 const std::string& input_source, const std::string& output_source); 2131 void prepare_sources(const typename TestCaseBase<API>::TestShaderType& input_shader_type, 2132 const typename TestCaseBase<API>::TestShaderType& output_shader_type, 2133 const std::string* input_shader_source, const std::string* output_shader_source, 2134 std::string& input_source, std::string& output_source); 2135 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType input_shader_type); 2136 }; 2137 2138 template <class API> 2139 class InteractionInterfaceArrays3 : public TestCaseBase<API> 2140 { 2141 public: 2142 /* Public methods */ InteractionInterfaceArrays3(Context & context)2143 InteractionInterfaceArrays3(Context& context) 2144 : TestCaseBase<API>(context, "InteractionInterfaceArrays3", 2145 " Verifies that 2-dimensional arrays of uniform interface blocks\n" 2146 " are correctly rejected.\n") 2147 { 2148 /* Left empty on purpose */ 2149 } 2150 ~InteractionInterfaceArrays3()2151 virtual ~InteractionInterfaceArrays3() 2152 { 2153 /* Left empty on purpose */ 2154 } 2155 2156 protected: 2157 /* Protected methods */ 2158 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 2159 }; 2160 2161 template <class API> 2162 class InteractionInterfaceArrays4 : public InteractionInterfaceArrays2<API> 2163 { 2164 public: 2165 /* Public methods */ InteractionInterfaceArrays4(Context & context)2166 InteractionInterfaceArrays4(Context& context) 2167 : InteractionInterfaceArrays2<API>(context, "InteractionInterfaceArrays4", 2168 " Verifies that 2-dimensional arrays of input and output interface blocks\n" 2169 " are correctly rejected.\n") 2170 { 2171 /* Left empty on purpose */ 2172 } 2173 ~InteractionInterfaceArrays4()2174 virtual ~InteractionInterfaceArrays4() 2175 { 2176 /* Left empty on purpose */ 2177 } 2178 2179 protected: 2180 /* Protected methods */ 2181 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType input_shader_type); 2182 }; 2183 2184 /** Implements test AtomicDeclaration, desription follows: 2185 * 2186 * Prepare a shader that declares "bar", a multidimensional array of atomic 2187 * counters. Shader should increment all entries of "bar". It is expected that 2188 * building of program will: 2189 * - pass when number of entries in "bar" is equal to a value of the 2190 * corresponding MAX_*_ATOMIC_COUNTERS constant, 2191 * - fail when number of entries in "bar" exceeds limit. 2192 * Test all supported shader stages separately. 2193 **/ 2194 template <class API> 2195 class AtomicDeclarationTest : public TestCaseBase<API> 2196 { 2197 public: 2198 /* Public methods */ AtomicDeclarationTest(Context & context)2199 AtomicDeclarationTest(Context& context) 2200 : TestCaseBase<API>(context, "AtomicDeclaration", 2201 " Verifies that atomic counters can be grouped in multidimensional arrays\n") 2202 { 2203 /* Left empty on purpose */ 2204 } 2205 ~AtomicDeclarationTest()2206 virtual ~AtomicDeclarationTest() 2207 { 2208 /* Left empty on purpose */ 2209 } 2210 2211 protected: 2212 /* Protected methods */ 2213 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 2214 }; 2215 2216 /** Implements test AtomicUsage, desription follows: 2217 * 2218 * Prepare a program like in "valid" case of AtomicDeclaration test, but use 2219 * layout qualifier with last binding and specific offset. Bind a buffer so all 2220 * entries in "bar" have unique values assigned. Select offset and size of 2221 * "bar" as follows: 2222 * - offset is 0, "bar" fills entire allowed space; 2223 * - offset is not 0, "bar" does not exceed any limit. 2224 * Test pass if buffer contents are correctly modified by execution of the 2225 * program. 2226 * Test all supported shader stages separately. 2227 **/ 2228 template <class API> 2229 class AtomicUsageTest : public TestCaseBase<API> 2230 { 2231 public: 2232 /* Public methods */ AtomicUsageTest(Context & context)2233 AtomicUsageTest(Context& context) 2234 : TestCaseBase<API>(context, "AtomicUsage", 2235 " Verifies that atomic counters grouped in multidimensional arrays can be used\n") 2236 { 2237 /* Left empty on purpose */ 2238 } 2239 ~AtomicUsageTest()2240 virtual ~AtomicUsageTest() 2241 { 2242 /* Left empty on purpose */ 2243 } 2244 2245 protected: 2246 /* Protected methods */ 2247 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 2248 2249 private: 2250 void execute(typename TestCaseBase<API>::TestShaderType tested_shader_type, glw::GLuint binding, glw::GLuint offset, 2251 glw::GLuint n_entries); 2252 }; 2253 2254 /** Implements "out" case of SubRoutineCalls test, description follows: 2255 * 2256 * Modify "function-calls" test in the following aspects: 2257 * - provide two subroutines instead of each function; 2258 * - "new" "out" subroutine should use different pattern of values; 2259 * - "new" "inout" subroutine should use division instead of multiplication; 2260 * - it is expected that "original" set will pass, while "new" set will fail. 2261 **/ 2262 template <class API> 2263 class SubroutineFunctionCalls1 : public TestCaseBase<API> 2264 { 2265 public: 2266 /* Public methods */ SubroutineFunctionCalls1(Context & context,const glw::GLchar * name,const glw::GLchar * description)2267 SubroutineFunctionCalls1(Context& context, const glw::GLchar* name, const glw::GLchar* description) 2268 : TestCaseBase<API>(context, name, description) 2269 { 2270 /* Left empty on purpose */ 2271 } 2272 SubroutineFunctionCalls1(Context & context)2273 SubroutineFunctionCalls1(Context& context) 2274 : TestCaseBase<API>(context, "SubroutineFunctionCalls1", 2275 " Declare two subroutines returning an 8-dimensional 64-element array as\n" 2276 " an out parameter, filled with unique values.\n" 2277 " Verifies that the values are returned as expected when this function\n" 2278 " is called.\n" 2279 " Repeat for the following primitive types: int, float,\n" 2280 " ivec2, ivec3, ivec4, vec2, vec3, vec4, mat2, mat3, mat4.\n") 2281 { 2282 /* Left empty on purpose */ 2283 } 2284 ~SubroutineFunctionCalls1()2285 virtual ~SubroutineFunctionCalls1() 2286 { 2287 /* Left empty on purpose */ 2288 } 2289 2290 protected: 2291 /* Protected methods */ 2292 void execute_dispatch_test(typename TestCaseBase<API>::TestShaderType tested_shader_type, 2293 const std::string& function_definition, const std::string& function_use, 2294 const std::string& verification, bool use_original, bool expect_invalid_result); 2295 2296 void execute_draw_test(typename TestCaseBase<API>::TestShaderType tested_shader_type, 2297 const std::string& function_definition, const std::string& function_use, 2298 const std::string& verification, bool use_original, bool expect_invalid_result); 2299 2300 std::string prepare_compute_shader(typename TestCaseBase<API>::TestShaderType tested_shader_type, 2301 const std::string& function_definition, const std::string& function_use, 2302 const std::string& verification); 2303 2304 std::string prepare_fragment_shader(typename TestCaseBase<API>::TestShaderType tested_shader_type, 2305 const std::string& function_definition, const std::string& function_use, 2306 const std::string& verification); 2307 2308 std::string prepare_geometry_shader(typename TestCaseBase<API>::TestShaderType tested_shader_type, 2309 const std::string& function_definition, const std::string& function_use, 2310 const std::string& verification); 2311 2312 std::string prepare_tess_ctrl_shader(typename TestCaseBase<API>::TestShaderType tested_shader_type, 2313 const std::string& function_definition, const std::string& function_use, 2314 const std::string& verification); 2315 2316 std::string prepare_tess_eval_shader(typename TestCaseBase<API>::TestShaderType tested_shader_type, 2317 const std::string& function_definition, const std::string& function_use, 2318 const std::string& verification); 2319 2320 std::string prepare_vertex_shader(typename TestCaseBase<API>::TestShaderType tested_shader_type, 2321 const std::string& function_definition, const std::string& function_use, 2322 const std::string& verification); 2323 2324 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 2325 }; 2326 2327 /** Implements "inout" case of SubRoutineCalls test, description follows: 2328 * 2329 * Modify "function-calls" test in the following aspects: 2330 * - provide two subroutines instead of each function; 2331 * - "new" "out" subroutine should use different pattern of values; 2332 * - "new" "inout" subroutine should use division instead of multiplication; 2333 * - it is expected that "original" set will pass, while "new" set will fail. 2334 **/ 2335 template <class API> 2336 class SubroutineFunctionCalls2 : public SubroutineFunctionCalls1<API> 2337 { 2338 public: 2339 /* Public methods */ SubroutineFunctionCalls2(Context & context)2340 SubroutineFunctionCalls2(Context& context) 2341 : SubroutineFunctionCalls1<API>(context, "SubroutineFunctionCalls2", 2342 " Declare two subroutines taking an inout parameter,\n" 2343 " which modifies each element in a unique way.\n" 2344 " Verifies that the results after returning are as expected.\n" 2345 " Repeat for the following primitive types: int, float,\n" 2346 " ivec2, ivec3, ivec4, vec2, vec3, vec4, mat2, mat3, mat4.\n") 2347 { 2348 /* Left empty on purpose */ 2349 } 2350 ~SubroutineFunctionCalls2()2351 virtual ~SubroutineFunctionCalls2() 2352 { 2353 /* Left empty on purpose */ 2354 } 2355 2356 protected: 2357 /* Protected methods */ 2358 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 2359 }; 2360 2361 template <class API> 2362 class SubroutineArgumentAliasing1 : public SubroutineFunctionCalls1<API> 2363 { 2364 public: 2365 /* Public methods */ SubroutineArgumentAliasing1(Context & context)2366 SubroutineArgumentAliasing1(Context& context) 2367 : SubroutineFunctionCalls1<API>( 2368 context, "SubroutineArgumentAliasing1", 2369 " Declare a function taking two 8-dimensional, 64-element parameters\n" 2370 " (e.g. void g(int x[2][2][2][2][2][2][2][2], int\n" 2371 " y[2][2][2][2][2][2][2][2]) and verify that after calling g(z,z),\n" 2372 " and overwriting one parameter with a constant value, the original values of z\n" 2373 " are accessible through the second parameter.\n" 2374 " Repeat for float and mat4 types.\n") 2375 { 2376 /* Left empty on purpose */ 2377 } 2378 ~SubroutineArgumentAliasing1()2379 virtual ~SubroutineArgumentAliasing1() 2380 { 2381 /* Left empty on purpose */ 2382 } 2383 2384 protected: 2385 /* Protected methods */ 2386 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 2387 }; 2388 2389 template <class API> 2390 class SubroutineArgumentAliasing2 : public SubroutineFunctionCalls1<API> 2391 { 2392 public: 2393 /* Public methods */ SubroutineArgumentAliasing2(Context & context)2394 SubroutineArgumentAliasing2(Context& context) 2395 : SubroutineFunctionCalls1<API>( 2396 context, "SubroutineArgumentAliasing2", 2397 " Declare two subroutines taking two 8-dimensional, 64-element parameters\n" 2398 " (e.g. void g(int x[2][2][2][2][2][2][2][2], int\n" 2399 " y[2][2][2][2][2][2][2][2]) and verify that after calling g(z,z),\n" 2400 " and overwriting one parameter with a constant value, the original values of z\n" 2401 " are accessible through the second inout parameter.\n" 2402 " Repeat for float and mat4 types.\n") 2403 { 2404 /* Left empty on purpose */ 2405 } 2406 ~SubroutineArgumentAliasing2()2407 virtual ~SubroutineArgumentAliasing2() 2408 { 2409 /* Left empty on purpose */ 2410 } 2411 2412 protected: 2413 /* Protected methods */ 2414 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 2415 }; 2416 2417 template <class API> 2418 class SubroutineArgumentAliasing3 : public SubroutineFunctionCalls1<API> 2419 { 2420 public: 2421 /* Public methods */ SubroutineArgumentAliasing3(Context & context)2422 SubroutineArgumentAliasing3(Context& context) 2423 : SubroutineFunctionCalls1<API>( 2424 context, "SubroutineArgumentAliasing3", 2425 " Declare two subroutines taking two 8-dimensional, 64-element parameters\n" 2426 " (e.g. void g(int x[2][2][2][2][2][2][2][2], int\n" 2427 " y[2][2][2][2][2][2][2][2]) and verify that after calling g(z,z),\n" 2428 " and overwriting x, out, parameter with a constant value, the original values of z\n" 2429 " are accessible through the y parameter.\n" 2430 " Repeat for float and mat4 types.\n") 2431 { 2432 /* Left empty on purpose */ 2433 } 2434 ~SubroutineArgumentAliasing3()2435 virtual ~SubroutineArgumentAliasing3() 2436 { 2437 /* Left empty on purpose */ 2438 } 2439 2440 protected: 2441 /* Protected methods */ 2442 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 2443 }; 2444 2445 template <class API> 2446 class SubroutineArgumentAliasing4 : public SubroutineFunctionCalls1<API> 2447 { 2448 public: 2449 /* Public methods */ SubroutineArgumentAliasing4(Context & context)2450 SubroutineArgumentAliasing4(Context& context) 2451 : SubroutineFunctionCalls1<API>( 2452 context, "SubroutineArgumentAliasing4", 2453 " Declare two subroutines taking two 8-dimensional, 64-element parameters\n" 2454 " (e.g. void g(int x[2][2][2][2][2][2][2][2], int\n" 2455 " y[2][2][2][2][2][2][2][2]) and verify that after calling g(z,z),\n" 2456 " and overwriting y, out, parameter with a constant value, the original values of z\n" 2457 " are accessible through the x parameter.\n" 2458 " Repeat for float and mat4 types.\n") 2459 { 2460 /* Left empty on purpose */ 2461 } 2462 ~SubroutineArgumentAliasing4()2463 virtual ~SubroutineArgumentAliasing4() 2464 { 2465 /* Left empty on purpose */ 2466 } 2467 2468 protected: 2469 /* Protected methods */ 2470 void test_shader_compilation(typename TestCaseBase<API>::TestShaderType tested_shader_type); 2471 }; 2472 2473 } /* ArraysOfArrays */ 2474 } /* glcts */ 2475 2476 #endif // _ES31CARRAYOFARRAYSTESTS_HPP 2477