1 #ifndef _VKTRANDOMUNIFORMBLOCKCASE_HPP
2 #define _VKTRANDOMUNIFORMBLOCKCASE_HPP
3 /*------------------------------------------------------------------------
4 * Vulkan Conformance Tests
5 * ------------------------
7 * Copyright (c) 2015 The Khronos Group Inc.
8 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
24 * \brief Random uniform block layout case.
25 *//*--------------------------------------------------------------------*/
27 #include "vktUniformBlockCase.hpp"
41 FEATURE_VECTORS = (1<<0),
42 FEATURE_MATRICES = (1<<1),
43 FEATURE_ARRAYS = (1<<2),
44 FEATURE_STRUCTS = (1<<3),
45 FEATURE_NESTED_STRUCTS = (1<<4),
46 FEATURE_INSTANCE_ARRAYS = (1<<5),
47 FEATURE_VERTEX_BLOCKS = (1<<6),
48 FEATURE_FRAGMENT_BLOCKS = (1<<7),
49 FEATURE_SHARED_BLOCKS = (1<<8),
50 FEATURE_UNUSED_UNIFORMS = (1<<9),
51 FEATURE_UNUSED_MEMBERS = (1<<10),
52 FEATURE_PACKED_LAYOUT = (1<<12),
53 FEATURE_SHARED_LAYOUT = (1<<13),
54 FEATURE_STD140_LAYOUT = (1<<14),
55 FEATURE_MATRIX_LAYOUT = (1<<15), //!< Matrix layout flags.
56 FEATURE_ARRAYS_OF_ARRAYS = (1<<16),
57 FEATURE_OUT_OF_ORDER_OFFSETS = (1<<17),
60 class RandomUniformBlockCase : public UniformBlockCase
63 RandomUniformBlockCase (tcu::TestContext& testCtx,
64 const std::string& name,
65 const std::string& description,
66 BufferMode bufferMode,
71 void generateBlock (de::Random& rnd, deUint32 layoutFlags);
72 void generateUniform (de::Random& rnd, UniformBlock& block);
73 VarType generateType (de::Random& rnd, int typeDepth, bool arrayOk);
75 const deUint32 m_features;
76 const int m_maxVertexBlocks;
77 const int m_maxFragmentBlocks;
78 const int m_maxSharedBlocks;
79 const int m_maxInstances;
80 const int m_maxArrayLength;
81 const int m_maxStructDepth;
82 const int m_maxBlockMembers;
83 const int m_maxStructMembers;
84 const deUint32 m_seed;
94 #endif // _VKTRANDOMUNIFORMBLOCKCASE_HPP