Merge "Further relax line verification in primitive bbox tests" into nougat-cts-dev...
[platform/upstream/VK-GL-CTS.git] / external / vulkancts / modules / vulkan / ubo / vktRandomUniformBlockCase.hpp
1 #ifndef _VKTRANDOMUNIFORMBLOCKCASE_HPP
2 #define _VKTRANDOMUNIFORMBLOCKCASE_HPP
3 /*------------------------------------------------------------------------
4  * Vulkan Conformance Tests
5  * ------------------------
6  *
7  * Copyright (c) 2015 The Khronos Group Inc.
8  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
9  *
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
13  *
14  *      http://www.apache.org/licenses/LICENSE-2.0
15  *
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.
21  *
22  *//*!
23  * \file
24  * \brief Random uniform block layout case.
25  *//*--------------------------------------------------------------------*/
26
27 #include "vktUniformBlockCase.hpp"
28
29 namespace de
30 {
31 class Random;
32 } // de
33
34 namespace vkt
35 {
36 namespace ubo
37 {
38
39 enum FeatureBits
40 {
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),
58 };
59
60 class RandomUniformBlockCase : public UniformBlockCase
61 {
62 public:
63                                                         RandomUniformBlockCase          (tcu::TestContext&              testCtx,
64                                                                                                                  const std::string&             name,
65                                                                                                                  const std::string&             description,
66                                                                                                                  BufferMode                             bufferMode,
67                                                                                                                  deUint32                               features,
68                                                                                                                  deUint32                               seed);
69
70 private:
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);
74
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;
85
86         int                                             m_blockNdx;
87         int                                             m_uniformNdx;
88         int                                             m_structNdx;
89 };
90
91 } // ubo
92 } // vkt
93
94 #endif // _VKTRANDOMUNIFORMBLOCKCASE_HPP