es31fFunctionalTests.cpp revision 1f99d6991ce9a27d32ec0543d95646fe4e7bf001
1/*------------------------------------------------------------------------- 2 * drawElements Quality Program OpenGL ES 3.1 Module 3 * ------------------------------------------------- 4 * 5 * Copyright 2014 The Android Open Source Project 6 * 7 * Licensed under the Apache License, Version 2.0 (the "License"); 8 * you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 * 19 *//*! 20 * \file 21 * \brief Functional Tests. 22 *//*--------------------------------------------------------------------*/ 23 24#include "es31fFunctionalTests.hpp" 25 26#include "glsShaderLibrary.hpp" 27#include "es31fBasicComputeShaderTests.hpp" 28#include "es31fComputeShaderBuiltinVarTests.hpp" 29#include "es31fDrawTests.hpp" 30#include "es31fShaderSharedVarTests.hpp" 31#include "es31fAtomicCounterTests.hpp" 32#include "es31fShaderAtomicOpTests.hpp" 33#include "es31fShaderImageLoadStoreTests.hpp" 34#include "es31fTessellationTests.hpp" 35#include "es31fSSBOLayoutTests.hpp" 36#include "es31fSSBOArrayLengthTests.hpp" 37#include "es31fShaderCommonFunctionTests.hpp" 38#include "es31fShaderPackingFunctionTests.hpp" 39#include "es31fShaderIntegerFunctionTests.hpp" 40#include "es31fStencilTexturingTests.hpp" 41#include "es31fShaderTextureSizeTests.hpp" 42#include "es31fShaderStateQueryTests.hpp" 43#include "es31fLayoutBindingTests.hpp" 44#include "es31fTextureLevelStateQueryTests.hpp" 45#include "es31fIntegerStateQueryTests.hpp" 46#include "es31fInternalFormatQueryTests.hpp" 47#include "es31fTextureFilteringTests.hpp" 48#include "es31fTextureFormatTests.hpp" 49#include "es31fTextureSpecificationTests.hpp" 50#include "es31fTextureMultisampleTests.hpp" 51#include "es31fMultisampleTests.hpp" 52#include "es31fSynchronizationTests.hpp" 53#include "es31fGeometryShaderTests.hpp" 54#include "es31fSampleShadingTests.hpp" 55#include "es31fSampleVariableTests.hpp" 56#include "es31fIndirectComputeDispatchTests.hpp" 57#include "es31fVertexAttributeBindingTests.hpp" 58#include "es31fVertexAttributeBindingStateQueryTests.hpp" 59#include "es31fShaderMultisampleInterpolationTests.hpp" 60#include "es31fShaderMultisampleInterpolationStateQueryTests.hpp" 61#include "es31fProgramUniformTests.hpp" 62#include "es31fOpaqueTypeIndexingTests.hpp" 63#include "es31fAdvancedBlendTests.hpp" 64#include "es31fSeparateShaderTests.hpp" 65#include "es31fUniformLocationTests.hpp" 66#include "es31fBuiltinPrecisionTests.hpp" 67#include "es31fTessellationGeometryInteractionTests.hpp" 68#include "es31fUniformBlockTests.hpp" 69#include "es31fDebugTests.hpp" 70#include "es31fFboColorbufferTests.hpp" 71#include "es31fFboNoAttachmentTests.hpp" 72#include "es31fProgramInterfaceQueryTests.hpp" 73#include "es31fTextureGatherTests.hpp" 74#include "es31fTextureFormatTests.hpp" 75#include "es31fTextureBufferTests.hpp" 76#include "es31fShaderBuiltinConstantTests.hpp" 77#include "es31fShaderHelperInvocationTests.hpp" 78#include "es31fPrimitiveBoundingBoxTests.hpp" 79 80namespace deqp 81{ 82namespace gles31 83{ 84namespace Functional 85{ 86 87class ShaderLibraryTest : public TestCaseGroup 88{ 89public: 90 ShaderLibraryTest (Context& context, const char* name, const char* description) 91 : TestCaseGroup (context, name, description) 92 , m_filename (name + std::string(".test")) 93 { 94 } 95 96 ShaderLibraryTest (Context& context, const char* filename, const char* name, const char* description) 97 : TestCaseGroup (context, name, description) 98 , m_filename (filename) 99 { 100 } 101 102 void init (void) 103 { 104 gls::ShaderLibrary shaderLibrary(m_testCtx, m_context.getRenderContext(), m_context.getContextInfo()); 105 std::string fileName = "shaders/" + m_filename; 106 std::vector<tcu::TestNode*> children = shaderLibrary.loadShaderFile(fileName.c_str()); 107 108 for (int i = 0; i < (int)children.size(); i++) 109 addChild(children[i]); 110 } 111 112private: 113 const std::string m_filename; 114}; 115 116class ShaderBuiltinVarTests : public TestCaseGroup 117{ 118public: 119 ShaderBuiltinVarTests (Context& context) 120 : TestCaseGroup(context, "builtin_var", "Shader Built-in Variable Tests") 121 { 122 } 123 124 void init (void) 125 { 126 addChild(new ComputeShaderBuiltinVarTests(m_context)); 127 } 128}; 129 130class ShaderBuiltinFunctionTests : public TestCaseGroup 131{ 132public: 133 ShaderBuiltinFunctionTests (Context& context) 134 : TestCaseGroup(context, "builtin_functions", "Built-in Function Tests") 135 { 136 } 137 138 void init (void) 139 { 140 addChild(new ShaderCommonFunctionTests (m_context)); 141 addChild(new ShaderPackingFunctionTests (m_context)); 142 addChild(new ShaderIntegerFunctionTests (m_context)); 143 addChild(new ShaderTextureSizeTests (m_context)); 144 addChild(createBuiltinPrecisionTests (m_context)); 145 } 146}; 147 148class ShaderLinkageTests : public TestCaseGroup 149{ 150public: 151 ShaderLinkageTests (Context& context) 152 : TestCaseGroup(context, "linkage", "Linkage Tests") 153 { 154 } 155 156 void init (void) 157 { 158 addChild(new ShaderLibraryTest(m_context, "linkage_geometry.test", "geometry", "Geometry shader")); 159 addChild(new ShaderLibraryTest(m_context, "linkage_tessellation.test", "tessellation", "Tessellation shader")); 160 addChild(new ShaderLibraryTest(m_context, "linkage_tessellation_geometry.test", "tessellation_geometry", "Tessellation and geometry shader")); 161 addChild(new ShaderLibraryTest(m_context, "linkage_shader_storage_block.test", "shader_storage_block", "Shader storage blocks")); 162 addChild(new ShaderLibraryTest(m_context, "linkage_io_block.test", "io_block", "Shader io blocks")); 163 } 164}; 165 166class ShaderTests : public TestCaseGroup 167{ 168public: 169 ShaderTests (Context& context) 170 : TestCaseGroup(context, "shaders", "Shading Language Tests") 171 { 172 } 173 174 void init (void) 175 { 176 addChild(new ShaderBuiltinVarTests (m_context)); 177 addChild(new ShaderBuiltinFunctionTests (m_context)); 178 addChild(new SampleVariableTests (m_context)); 179 addChild(new ShaderMultisampleInterpolationTests(m_context)); 180 addChild(new OpaqueTypeIndexingTests (m_context)); 181 addChild(new ShaderLibraryTest (m_context, "functions", "Function Tests")); 182 addChild(new ShaderLibraryTest (m_context, "arrays_of_arrays", "Arrays of Arrays Tests")); 183 addChild(new ShaderLinkageTests (m_context)); 184 addChild(new ShaderBuiltinConstantTests (m_context)); 185 addChild(new ShaderHelperInvocationTests (m_context)); 186 addChild(new ShaderLibraryTest (m_context, "implicit_conversions", "GL_EXT_shader_implicit_conversions Tests")); 187 } 188}; 189 190class ComputeTests : public TestCaseGroup 191{ 192public: 193 ComputeTests (Context& context) 194 : TestCaseGroup(context, "compute", "Compute Shader Tests") 195 { 196 } 197 198 void init (void) 199 { 200 addChild(new BasicComputeShaderTests (m_context)); 201 addChild(new ShaderSharedVarTests (m_context)); 202 addChild(new IndirectComputeDispatchTests (m_context)); 203 } 204}; 205 206class SSBOTests : public TestCaseGroup 207{ 208public: 209 SSBOTests (Context& context) 210 : TestCaseGroup(context, "ssbo", "Shader Storage Buffer Object Tests") 211 { 212 } 213 214 void init (void) 215 { 216 addChild(new SSBOLayoutTests (m_context)); 217 addChild(new ShaderAtomicOpTests (m_context, "atomic", ATOMIC_OPERAND_BUFFER_VARIABLE)); 218 addChild(new SSBOArrayLengthTests (m_context)); 219 } 220}; 221 222class TextureTests : public TestCaseGroup 223{ 224public: 225 TextureTests (Context& context) 226 : TestCaseGroup(context, "texture", "Texture tests") 227 { 228 } 229 230 void init (void) 231 { 232 addChild(new TextureFilteringTests (m_context)); 233 addChild(new TextureFormatTests (m_context)); 234 addChild(new TextureSpecificationTests (m_context)); 235 addChild(new TextureMultisampleTests (m_context)); 236 addChild(new TextureGatherTests (m_context)); 237 addChild(createTextureBufferTests (m_context)); 238 } 239}; 240 241class StateQueryTests : public TestCaseGroup 242{ 243public: 244 StateQueryTests (Context& context) 245 : TestCaseGroup(context, "state_query", "State query tests") 246 { 247 } 248 249 void init (void) 250 { 251 addChild(new IntegerStateQueryTests (m_context)); 252 addChild(new TextureLevelStateQueryTests (m_context)); 253 addChild(new ShaderStateQueryTests (m_context)); 254 addChild(new InternalFormatQueryTests (m_context)); 255 addChild(new VertexAttributeBindingStateQueryTests (m_context)); 256 addChild(new ShaderMultisampleInterpolationStateQueryTests (m_context)); 257 } 258}; 259 260class FboTests : public TestCaseGroup 261{ 262public: 263 FboTests (Context& context) 264 : TestCaseGroup(context, "fbo", "Framebuffer Object Tests") 265 { 266 } 267 268 void init (void) 269 { 270 addChild(new FboColorTests (m_context)); 271 addChild(createFboNoAttachmentTests (m_context)); 272 addChild(createFboNoAttachmentCompletenessTests (m_context)); 273 } 274}; 275 276FunctionalTests::FunctionalTests (Context& context) 277 : TestCaseGroup(context, "functional", "Functionality Tests") 278{ 279} 280 281FunctionalTests::~FunctionalTests (void) 282{ 283} 284 285void FunctionalTests::init (void) 286{ 287 addChild(new ShaderTests (m_context)); 288 addChild(new ComputeTests (m_context)); 289 addChild(new DrawTests (m_context)); 290 addChild(new TessellationTests (m_context)); 291 addChild(new SSBOTests (m_context)); 292 addChild(new UniformBlockTests (m_context)); 293 addChild(new ShaderImageLoadStoreTests (m_context)); 294 addChild(new AtomicCounterTests (m_context)); 295 addChild(new StencilTexturingTests (m_context)); 296 addChild(new TextureTests (m_context)); 297 addChild(new StateQueryTests (m_context)); 298 addChild(new MultisampleTests (m_context)); 299 addChild(new SynchronizationTests (m_context)); 300 addChild(new GeometryShaderTests (m_context)); 301 addChild(new SampleShadingTests (m_context)); 302 addChild(new VertexAttributeBindingTests (m_context)); 303 addChild(new ProgramUniformTests (m_context)); 304 addChild(new AdvancedBlendTests (m_context)); 305 addChild(createSeparateShaderTests (m_context)); 306 addChild(new UniformLocationTests (m_context)); 307 addChild(new TessellationGeometryInteractionTests (m_context)); 308 addChild(new DebugTests (m_context)); 309 addChild(new FboTests (m_context)); 310 addChild(new ProgramInterfaceQueryTests (m_context)); 311 addChild(new LayoutBindingTests (m_context)); 312 addChild(new PrimitiveBoundingBoxTests (m_context)); 313 314} 315 316} // Functional 317} // gles31 318} // deqp 319