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