xref: /aosp_15_r20/external/deqp/external/openglcts/modules/common/glcConfigList.hpp (revision 35238bce31c2a825756842865a792f8cf7f89930)
1 #ifndef _GLCCONFIGLIST_HPP
2 #define _GLCCONFIGLIST_HPP
3 /*-------------------------------------------------------------------------
4  * OpenGL Conformance Test Suite
5  * -----------------------------
6  *
7  * Copyright (c) 2016 Google Inc.
8  * Copyright (c) 2016 The Khronos Group Inc.
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 CTS rendering configuration list utility.
25  */ /*-------------------------------------------------------------------*/
26 
27 #include "gluPlatform.hpp"
28 #include "tcuCommandLine.hpp"
29 #include "tcuDefs.hpp"
30 
31 #include <string>
32 #include <vector>
33 
34 namespace glcts
35 {
36 
37 enum ConfigType
38 {
39     CONFIGTYPE_DEFAULT = 0, //!< Only default config (no parameters).
40     CONFIGTYPE_EGL,         //!< EGL config.
41     CONFIGTYPE_WGL,         //!< WGL config.
42 
43     CONFIGTYPE_LAST
44 };
45 
46 enum SurfaceTypeFlags
47 {
48     SURFACETYPE_WINDOW  = (1 << tcu::SURFACETYPE_WINDOW),
49     SURFACETYPE_PIXMAP  = (1 << tcu::SURFACETYPE_OFFSCREEN_NATIVE),
50     SURFACETYPE_PBUFFER = (1 << tcu::SURFACETYPE_OFFSCREEN_GENERIC),
51     SURFACETYPE_FBO     = (1 << tcu::SURFACETYPE_FBO),
52 };
53 
54 enum ExcludeReason
55 {
56     EXCLUDEREASON_NOT_COMPATIBLE = 0, //!< Not compatible with target API
57     EXCLUDEREASON_NOT_CONFORMANT,     //!< Compatible but not conformant
58     EXCLUDEREASON_MSAA,               //!< Compatible but not testable with current tests
59     EXCLUDEREASON_FLOAT,              //!< Compatible but not testable with current tests
60     EXCLUDEREASON_YUV,                //!< Compatible but not testable with current tests
61     EXCLUDEREASON_LAST
62 };
63 
64 struct Config
65 {
Configglcts::Config66     Config(ConfigType type_, int id_, uint32_t surfaceTypes_) : type(type_), id(id_), surfaceTypes(surfaceTypes_)
67     {
68     }
69 
Configglcts::Config70     Config(void) : type(CONFIGTYPE_LAST), id(0), surfaceTypes(0)
71     {
72     }
73 
74     ConfigType type;
75     int id;
76     uint32_t surfaceTypes;
77 };
78 
79 struct ExcludedConfig
80 {
ExcludedConfigglcts::ExcludedConfig81     ExcludedConfig(ConfigType type_, int id_, ExcludeReason reason_) : type(type_), id(id_), reason(reason_)
82     {
83     }
84 
ExcludedConfigglcts::ExcludedConfig85     ExcludedConfig(void) : type(CONFIGTYPE_LAST), id(0), reason(EXCLUDEREASON_LAST)
86     {
87     }
88 
89     ConfigType type;
90     int id;
91     ExcludeReason reason;
92 };
93 
94 struct AOSPConfig
95 {
AOSPConfigglcts::AOSPConfig96     AOSPConfig(ConfigType type_, int id_, uint32_t surfaceTypes_, int32_t redBits_, int32_t greenBits_,
97                int32_t blueBits_, int32_t alphaBits_, int32_t depthBits_, int32_t stencilBits_, int32_t samples_)
98         : type(type_)
99         , id(id_)
100         , surfaceTypes(surfaceTypes_)
101         , redBits(redBits_)
102         , greenBits(greenBits_)
103         , blueBits(blueBits_)
104         , alphaBits(alphaBits_)
105         , depthBits(depthBits_)
106         , stencilBits(stencilBits_)
107         , samples(samples_)
108     {
109     }
110 
AOSPConfigglcts::AOSPConfig111     AOSPConfig(void)
112         : type(CONFIGTYPE_LAST)
113         , id(0)
114         , surfaceTypes(0)
115         , redBits(0)
116         , greenBits(0)
117         , blueBits(0)
118         , alphaBits(0)
119         , depthBits(0)
120         , stencilBits(0)
121         , samples(0)
122     {
123     }
124 
125     ConfigType type;
126     int id;
127     uint32_t surfaceTypes;
128     int32_t redBits;
129     int32_t greenBits;
130     int32_t blueBits;
131     int32_t alphaBits;
132     int32_t depthBits;
133     int32_t stencilBits;
134     int32_t samples;
135 };
136 
137 class ConfigList
138 {
139 public:
140     // Configs exposed by an implementation which are required to pass all non-AOSP tests.
141     // This includes all configs marked as conformant but not multisample configs.
142     std::vector<Config> configs;
143     // Configs exposed by an implementation which are not required to pass the CTS.
144     // This includes non-conformant and multisample configs.
145     std::vector<ExcludedConfig> excludedConfigs;
146     // Configs exposed by an implementation which will be used to determine AOSP runs parameters.
147     // This includes all configs marked as conformant.
148     std::vector<AOSPConfig> aospConfigs;
149 };
150 
151 void getDefaultConfigList(tcu::Platform &platform, glu::ApiType type, ConfigList &configList);
152 
153 } // namespace glcts
154 
155 #endif // _GLCCONFIGLIST_HPP
156