es31fFunctionalTests.cpp revision cacbbf83a31d6ae30f08ee58117cc6b037354806
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 "es31fBooleanStateQueryTests.hpp" 48#include "es31fIndexedStateQueryTests.hpp" 49#include "es31fTextureStateQueryTests.hpp" 50#include "es31fFramebufferDefaultStateQueryTests.hpp" 51#include "es31fProgramPipelineStateQueryTests.hpp" 52#include "es31fProgramStateQueryTests.hpp" 53#include "es31fSamplerStateQueryTests.hpp" 54#include "es31fTextureFilteringTests.hpp" 55#include "es31fTextureFormatTests.hpp" 56#include "es31fTextureSpecificationTests.hpp" 57#include "es31fTextureMultisampleTests.hpp" 58#include "es31fMultisampleTests.hpp" 59#include "es31fSynchronizationTests.hpp" 60#include "es31fGeometryShaderTests.hpp" 61#include "es31fSampleShadingTests.hpp" 62#include "es31fSampleVariableTests.hpp" 63#include "es31fIndirectComputeDispatchTests.hpp" 64#include "es31fVertexAttributeBindingTests.hpp" 65#include "es31fVertexAttributeBindingStateQueryTests.hpp" 66#include "es31fShaderMultisampleInterpolationTests.hpp" 67#include "es31fShaderMultisampleInterpolationStateQueryTests.hpp" 68#include "es31fProgramUniformTests.hpp" 69#include "es31fOpaqueTypeIndexingTests.hpp" 70#include "es31fAdvancedBlendTests.hpp" 71#include "es31fSeparateShaderTests.hpp" 72#include "es31fUniformLocationTests.hpp" 73#include "es31fBuiltinPrecisionTests.hpp" 74#include "es31fTessellationGeometryInteractionTests.hpp" 75#include "es31fUniformBlockTests.hpp" 76#include "es31fDebugTests.hpp" 77#include "es31fFboColorbufferTests.hpp" 78#include "es31fFboNoAttachmentTests.hpp" 79#include "es31fProgramInterfaceQueryTests.hpp" 80#include "es31fTextureGatherTests.hpp" 81#include "es31fTextureFormatTests.hpp" 82#include "es31fTextureBufferTests.hpp" 83#include "es31fShaderBuiltinConstantTests.hpp" 84#include "es31fShaderHelperInvocationTests.hpp" 85#include "es31fPrimitiveBoundingBoxTests.hpp" 86#include "es31fAndroidExtensionPackES31ATests.hpp" 87#include "es31fCopyImageTests.hpp" 88#include "es31fDrawBuffersIndexedTests.hpp" 89 90namespace deqp 91{ 92namespace gles31 93{ 94namespace Functional 95{ 96 97class ShaderLibraryTest : public TestCaseGroup 98{ 99public: 100 ShaderLibraryTest (Context& context, const char* name, const char* description) 101 : TestCaseGroup (context, name, description) 102 , m_filename (name + std::string(".test")) 103 { 104 } 105 106 ShaderLibraryTest (Context& context, const char* filename, const char* name, const char* description) 107 : TestCaseGroup (context, name, description) 108 , m_filename (filename) 109 { 110 } 111 112 void init (void) 113 { 114 gls::ShaderLibrary shaderLibrary(m_testCtx, m_context.getRenderContext(), m_context.getContextInfo()); 115 std::string fileName = "shaders/" + m_filename; 116 std::vector<tcu::TestNode*> children = shaderLibrary.loadShaderFile(fileName.c_str()); 117 118 for (int i = 0; i < (int)children.size(); i++) 119 addChild(children[i]); 120 } 121 122private: 123 const std::string m_filename; 124}; 125 126class ShaderBuiltinVarTests : public TestCaseGroup 127{ 128public: 129 ShaderBuiltinVarTests (Context& context) 130 : TestCaseGroup(context, "builtin_var", "Shader Built-in Variable Tests") 131 { 132 } 133 134 void init (void) 135 { 136 addChild(new ComputeShaderBuiltinVarTests(m_context)); 137 } 138}; 139 140class ShaderBuiltinFunctionTests : public TestCaseGroup 141{ 142public: 143 ShaderBuiltinFunctionTests (Context& context) 144 : TestCaseGroup(context, "builtin_functions", "Built-in Function Tests") 145 { 146 } 147 148 void init (void) 149 { 150 addChild(new ShaderCommonFunctionTests (m_context)); 151 addChild(new ShaderPackingFunctionTests (m_context)); 152 addChild(new ShaderIntegerFunctionTests (m_context)); 153 addChild(new ShaderTextureSizeTests (m_context)); 154 addChild(createBuiltinPrecisionTests (m_context)); 155 } 156}; 157 158class ShaderLinkageTests : public TestCaseGroup 159{ 160public: 161 ShaderLinkageTests (Context& context) 162 : TestCaseGroup(context, "linkage", "Linkage Tests") 163 { 164 } 165 166 void init (void) 167 { 168 addChild(new ShaderLibraryTest(m_context, "linkage_geometry.test", "geometry", "Geometry shader")); 169 addChild(new ShaderLibraryTest(m_context, "linkage_tessellation.test", "tessellation", "Tessellation shader")); 170 addChild(new ShaderLibraryTest(m_context, "linkage_tessellation_geometry.test", "tessellation_geometry", "Tessellation and geometry shader")); 171 addChild(new ShaderLibraryTest(m_context, "linkage_shader_storage_block.test", "shader_storage_block", "Shader storage blocks")); 172 addChild(new ShaderLibraryTest(m_context, "linkage_io_block.test", "io_block", "Shader io blocks")); 173 } 174}; 175 176class ShaderTests : public TestCaseGroup 177{ 178public: 179 ShaderTests (Context& context) 180 : TestCaseGroup(context, "shaders", "Shading Language Tests") 181 { 182 } 183 184 void init (void) 185 { 186 addChild(new ShaderBuiltinVarTests (m_context)); 187 addChild(new ShaderBuiltinFunctionTests (m_context)); 188 addChild(new SampleVariableTests (m_context)); 189 addChild(new ShaderMultisampleInterpolationTests(m_context)); 190 addChild(new OpaqueTypeIndexingTests (m_context)); 191 addChild(new ShaderLibraryTest (m_context, "functions", "Function Tests")); 192 addChild(new ShaderLibraryTest (m_context, "arrays", "Arrays Tests")); 193 addChild(new ShaderLibraryTest (m_context, "arrays_of_arrays", "Arrays of Arrays Tests")); 194 addChild(new ShaderLinkageTests (m_context)); 195 addChild(new ShaderBuiltinConstantTests (m_context)); 196 addChild(new ShaderHelperInvocationTests (m_context)); 197 addChild(new ShaderLibraryTest (m_context, "implicit_conversions", "GL_EXT_shader_implicit_conversions Tests")); 198 addChild(new ShaderLibraryTest (m_context, "uniform_block", "Uniform block tests")); 199 } 200}; 201 202class ComputeTests : public TestCaseGroup 203{ 204public: 205 ComputeTests (Context& context) 206 : TestCaseGroup(context, "compute", "Compute Shader Tests") 207 { 208 } 209 210 void init (void) 211 { 212 addChild(new BasicComputeShaderTests (m_context)); 213 addChild(new ShaderSharedVarTests (m_context)); 214 addChild(new IndirectComputeDispatchTests (m_context)); 215 } 216}; 217 218class SSBOTests : public TestCaseGroup 219{ 220public: 221 SSBOTests (Context& context) 222 : TestCaseGroup(context, "ssbo", "Shader Storage Buffer Object Tests") 223 { 224 } 225 226 void init (void) 227 { 228 addChild(new SSBOLayoutTests (m_context)); 229 addChild(new ShaderAtomicOpTests (m_context, "atomic", ATOMIC_OPERAND_BUFFER_VARIABLE)); 230 addChild(new SSBOArrayLengthTests (m_context)); 231 } 232}; 233 234class TextureTests : public TestCaseGroup 235{ 236public: 237 TextureTests (Context& context) 238 : TestCaseGroup(context, "texture", "Texture tests") 239 { 240 } 241 242 void init (void) 243 { 244 addChild(new TextureFilteringTests (m_context)); 245 addChild(new TextureFormatTests (m_context)); 246 addChild(new TextureSpecificationTests (m_context)); 247 addChild(new TextureMultisampleTests (m_context)); 248 addChild(new TextureGatherTests (m_context)); 249 addChild(createTextureBufferTests (m_context)); 250 } 251}; 252 253class StateQueryTests : public TestCaseGroup 254{ 255public: 256 StateQueryTests (Context& context) 257 : TestCaseGroup(context, "state_query", "State query tests") 258 { 259 } 260 261 void init (void) 262 { 263 addChild(new BooleanStateQueryTests (m_context)); 264 addChild(new IntegerStateQueryTests (m_context)); 265 addChild(new IndexedStateQueryTests (m_context)); 266 addChild(new TextureStateQueryTests (m_context)); 267 addChild(new TextureLevelStateQueryTests (m_context)); 268 addChild(new SamplerStateQueryTests (m_context)); 269 addChild(new ShaderStateQueryTests (m_context)); 270 addChild(new InternalFormatQueryTests (m_context)); 271 addChild(new VertexAttributeBindingStateQueryTests (m_context)); 272 addChild(new ShaderMultisampleInterpolationStateQueryTests (m_context)); 273 addChild(new FramebufferDefaultStateQueryTests (m_context)); 274 addChild(new ProgramStateQueryTests (m_context)); 275 addChild(new ProgramPipelineStateQueryTests (m_context)); 276 } 277}; 278 279class FboTests : public TestCaseGroup 280{ 281public: 282 FboTests (Context& context) 283 : TestCaseGroup(context, "fbo", "Framebuffer Object Tests") 284 { 285 } 286 287 void init (void) 288 { 289 addChild(new FboColorTests (m_context)); 290 addChild(createFboNoAttachmentTests (m_context)); 291 addChild(createFboNoAttachmentCompletenessTests (m_context)); 292 } 293}; 294 295FunctionalTests::FunctionalTests (Context& context) 296 : TestCaseGroup(context, "functional", "Functionality Tests") 297{ 298} 299 300FunctionalTests::~FunctionalTests (void) 301{ 302} 303 304void FunctionalTests::init (void) 305{ 306 addChild(new ShaderTests (m_context)); 307 addChild(new ComputeTests (m_context)); 308 addChild(new DrawTests (m_context)); 309 addChild(new TessellationTests (m_context)); 310 addChild(new SSBOTests (m_context)); 311 addChild(new UniformBlockTests (m_context)); 312 addChild(new ShaderImageLoadStoreTests (m_context)); 313 addChild(new AtomicCounterTests (m_context)); 314 addChild(new StencilTexturingTests (m_context)); 315 addChild(new TextureTests (m_context)); 316 addChild(new StateQueryTests (m_context)); 317 addChild(new MultisampleTests (m_context)); 318 addChild(new SynchronizationTests (m_context)); 319 addChild(new GeometryShaderTests (m_context)); 320 addChild(new SampleShadingTests (m_context)); 321 addChild(new VertexAttributeBindingTests (m_context)); 322 addChild(new ProgramUniformTests (m_context)); 323 addChild(new AdvancedBlendTests (m_context)); 324 addChild(createSeparateShaderTests (m_context)); 325 addChild(new UniformLocationTests (m_context)); 326 addChild(new TessellationGeometryInteractionTests (m_context)); 327 addChild(new DebugTests (m_context)); 328 addChild(new FboTests (m_context)); 329 addChild(new ProgramInterfaceQueryTests (m_context)); 330 addChild(new LayoutBindingTests (m_context)); 331 addChild(new PrimitiveBoundingBoxTests (m_context)); 332 addChild(new AndroidExtensionPackES31ATests (m_context)); 333 addChild(createCopyImageTests (m_context)); 334 addChild(createDrawBuffersIndexedTests (m_context)); 335} 336 337} // Functional 338} // gles31 339} // deqp 340