1 #ifndef _ES31FPROGRAMINTERFACEQUERYTESTCASE_HPP 2 #define _ES31FPROGRAMINTERFACEQUERYTESTCASE_HPP 3 /*------------------------------------------------------------------------- 4 * drawElements Quality Program OpenGL ES 3.1 Module 5 * ------------------------------------------------- 6 * 7 * Copyright 2014 The Android Open Source Project 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 Program interface query test case 24 *//*--------------------------------------------------------------------*/ 25 26 #include "tcuDefs.hpp" 27 #include "tes31TestCase.hpp" 28 #include "es31fProgramInterfaceDefinition.hpp" 29 30 namespace deqp 31 { 32 namespace gles31 33 { 34 namespace Functional 35 { 36 37 struct ProgramResourceQueryTestTarget 38 { 39 ProgramResourceQueryTestTarget (ProgramInterface interface_, deUint32 propFlags_); 40 41 ProgramInterface interface; 42 deUint32 propFlags; 43 }; 44 45 enum ProgramResourcePropFlags 46 { 47 PROGRAMRESOURCEPROP_ARRAY_SIZE = (1 << 1), 48 PROGRAMRESOURCEPROP_ARRAY_STRIDE = (1 << 2), 49 PROGRAMRESOURCEPROP_ATOMIC_COUNTER_BUFFER_INDEX = (1 << 3), 50 PROGRAMRESOURCEPROP_BLOCK_INDEX = (1 << 4), 51 PROGRAMRESOURCEPROP_LOCATION = (1 << 5), 52 PROGRAMRESOURCEPROP_MATRIX_ROW_MAJOR = (1 << 6), 53 PROGRAMRESOURCEPROP_MATRIX_STRIDE = (1 << 7), 54 PROGRAMRESOURCEPROP_NAME_LENGTH = (1 << 8), 55 PROGRAMRESOURCEPROP_OFFSET = (1 << 9), 56 PROGRAMRESOURCEPROP_REFERENCED_BY_SHADER = (1 << 10), 57 PROGRAMRESOURCEPROP_TYPE = (1 << 11), 58 PROGRAMRESOURCEPROP_BUFFER_BINDING = (1 << 12), 59 PROGRAMRESOURCEPROP_BUFFER_DATA_SIZE = (1 << 13), 60 PROGRAMRESOURCEPROP_ACTIVE_VARIABLES = (1 << 14), 61 PROGRAMRESOURCEPROP_TOP_LEVEL_ARRAY_SIZE = (1 << 15), 62 PROGRAMRESOURCEPROP_TOP_LEVEL_ARRAY_STRIDE = (1 << 16), 63 PROGRAMRESOURCEPROP_IS_PER_PATCH = (1 << 17), 64 65 PROGRAMRESOURCEPROP_UNIFORM_INTERFACE_MASK = PROGRAMRESOURCEPROP_ARRAY_SIZE | 66 PROGRAMRESOURCEPROP_ARRAY_STRIDE | 67 PROGRAMRESOURCEPROP_ATOMIC_COUNTER_BUFFER_INDEX | 68 PROGRAMRESOURCEPROP_BLOCK_INDEX | 69 PROGRAMRESOURCEPROP_LOCATION | 70 PROGRAMRESOURCEPROP_MATRIX_ROW_MAJOR | 71 PROGRAMRESOURCEPROP_MATRIX_STRIDE | 72 PROGRAMRESOURCEPROP_NAME_LENGTH | 73 PROGRAMRESOURCEPROP_OFFSET | 74 PROGRAMRESOURCEPROP_REFERENCED_BY_SHADER | 75 PROGRAMRESOURCEPROP_TYPE, 76 77 PROGRAMRESOURCEPROP_UNIFORM_BLOCK_INTERFACE_MASK = PROGRAMRESOURCEPROP_NAME_LENGTH | 78 PROGRAMRESOURCEPROP_REFERENCED_BY_SHADER | 79 PROGRAMRESOURCEPROP_BUFFER_BINDING | 80 PROGRAMRESOURCEPROP_BUFFER_DATA_SIZE | 81 PROGRAMRESOURCEPROP_ACTIVE_VARIABLES, 82 83 PROGRAMRESOURCEPROP_SHADER_STORAGE_BLOCK_MASK = PROGRAMRESOURCEPROP_NAME_LENGTH | 84 PROGRAMRESOURCEPROP_REFERENCED_BY_SHADER | 85 PROGRAMRESOURCEPROP_BUFFER_BINDING | 86 PROGRAMRESOURCEPROP_BUFFER_DATA_SIZE | 87 PROGRAMRESOURCEPROP_ACTIVE_VARIABLES, 88 89 PROGRAMRESOURCEPROP_PROGRAM_INPUT_MASK = PROGRAMRESOURCEPROP_ARRAY_SIZE | 90 PROGRAMRESOURCEPROP_LOCATION | 91 PROGRAMRESOURCEPROP_NAME_LENGTH | 92 PROGRAMRESOURCEPROP_REFERENCED_BY_SHADER | 93 PROGRAMRESOURCEPROP_TYPE | 94 PROGRAMRESOURCEPROP_IS_PER_PATCH, 95 96 PROGRAMRESOURCEPROP_PROGRAM_OUTPUT_MASK = PROGRAMRESOURCEPROP_ARRAY_SIZE | 97 PROGRAMRESOURCEPROP_LOCATION | 98 PROGRAMRESOURCEPROP_NAME_LENGTH | 99 PROGRAMRESOURCEPROP_REFERENCED_BY_SHADER | 100 PROGRAMRESOURCEPROP_TYPE | 101 PROGRAMRESOURCEPROP_IS_PER_PATCH, 102 103 PROGRAMRESOURCEPROP_BUFFER_VARIABLE_MASK = PROGRAMRESOURCEPROP_ARRAY_SIZE | 104 PROGRAMRESOURCEPROP_ARRAY_STRIDE | 105 PROGRAMRESOURCEPROP_BLOCK_INDEX | 106 PROGRAMRESOURCEPROP_MATRIX_ROW_MAJOR | 107 PROGRAMRESOURCEPROP_MATRIX_STRIDE | 108 PROGRAMRESOURCEPROP_NAME_LENGTH | 109 PROGRAMRESOURCEPROP_OFFSET | 110 PROGRAMRESOURCEPROP_REFERENCED_BY_SHADER | 111 PROGRAMRESOURCEPROP_TOP_LEVEL_ARRAY_SIZE | 112 PROGRAMRESOURCEPROP_TOP_LEVEL_ARRAY_STRIDE | 113 PROGRAMRESOURCEPROP_TYPE, 114 115 PROGRAMRESOURCEPROP_TRANSFORM_FEEDBACK_VARYING_MASK = PROGRAMRESOURCEPROP_ARRAY_SIZE | 116 PROGRAMRESOURCEPROP_NAME_LENGTH | 117 PROGRAMRESOURCEPROP_TYPE, 118 }; 119 120 class ProgramInterfaceQueryTestCase : public TestCase 121 { 122 public: 123 ProgramInterfaceQueryTestCase (Context& context, const char* name, const char* description, ProgramResourceQueryTestTarget queryTarget); 124 ~ProgramInterfaceQueryTestCase (void); 125 126 protected: 127 ProgramInterface getTargetInterface (void) const; 128 129 private: 130 const ProgramInterfaceDefinition::Program* getAndCheckProgramDefinition (void); 131 int getMaxPatchVertices (void); 132 IterateResult iterate (void); 133 134 virtual const ProgramInterfaceDefinition::Program* getProgramDefinition (void) const = 0; 135 virtual std::vector<std::string> getQueryTargetResources (void) const = 0; 136 137 const ProgramResourceQueryTestTarget m_queryTarget; 138 }; 139 140 void checkProgramResourceUsage (const ProgramInterfaceDefinition::Program* program, const glw::Functions& gl, tcu::TestLog& log); 141 142 } // Functional 143 } // gles31 144 } // deqp 145 146 #endif // _ES31FPROGRAMINTERFACEQUERYTESTCASE_HPP 147