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