1 #ifndef _GLSRANDOMUNIFORMBLOCKCASE_HPP
2 #define _GLSRANDOMUNIFORMBLOCKCASE_HPP
3 /*-------------------------------------------------------------------------
4 * drawElements Quality Program OpenGL (ES) Module
5 * -----------------------------------------------
7 * Copyright 2014 The Android Open Source Project
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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.
23 * \brief Random uniform block layout case.
24 *//*--------------------------------------------------------------------*/
26 #include "tcuDefs.hpp"
27 #include "tcuTestCase.hpp"
28 #include "glsUniformBlockCase.hpp"
45 FEATURE_VECTORS = (1<<0),
46 FEATURE_MATRICES = (1<<1),
47 FEATURE_ARRAYS = (1<<2),
48 FEATURE_STRUCTS = (1<<3),
49 FEATURE_NESTED_STRUCTS = (1<<4),
50 FEATURE_INSTANCE_ARRAYS = (1<<5),
51 FEATURE_VERTEX_BLOCKS = (1<<6),
52 FEATURE_FRAGMENT_BLOCKS = (1<<7),
53 FEATURE_SHARED_BLOCKS = (1<<8),
54 FEATURE_UNUSED_UNIFORMS = (1<<9),
55 FEATURE_UNUSED_MEMBERS = (1<<10),
56 FEATURE_PACKED_LAYOUT = (1<<11),
57 FEATURE_SHARED_LAYOUT = (1<<12),
58 FEATURE_STD140_LAYOUT = (1<<13),
59 FEATURE_MATRIX_LAYOUT = (1<<14), //!< Matrix layout flags.
60 FEATURE_ARRAYS_OF_ARRAYS = (1<<15)
65 class RandomUniformBlockCase : public UniformBlockCase
68 RandomUniformBlockCase (tcu::TestContext& testCtx,
69 glu::RenderContext& renderCtx,
70 glu::GLSLVersion glslVersion,
72 const char* description,
73 BufferMode bufferMode,
80 void generateBlock (de::Random& rnd, deUint32 layoutFlags);
81 void generateUniform (de::Random& rnd, ub::UniformBlock& block);
82 ub::VarType generateType (de::Random& rnd, int typeDepth, bool arrayOk);
84 const deUint32 m_features;
85 const int m_maxVertexBlocks;
86 const int m_maxFragmentBlocks;
87 const int m_maxSharedBlocks;
88 const int m_maxInstances;
89 const int m_maxArrayLength;
90 const int m_maxStructDepth;
91 const int m_maxBlockMembers;
92 const int m_maxStructMembers;
93 const deUint32 m_seed;
103 #endif // _GLSRANDOMUNIFORMBLOCKCASE_HPP