xref: /aosp_15_r20/external/deqp/external/openglcts/modules/common/glcConfigList.cpp (revision 35238bce31c2a825756842865a792f8cf7f89930)
1 /*-------------------------------------------------------------------------
2  * OpenGL Conformance Test Suite
3  * -----------------------------
4  *
5  * Copyright (c) 2016 Google Inc.
6  * Copyright (c) 2016 The Khronos Group Inc.
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */ /*!
21  * \file
22  * \brief CTS rendering configuration list utility.
23  */ /*-------------------------------------------------------------------*/
24 
25 #include "glcConfigList.hpp"
26 #include "glcConfigListEGL.hpp"
27 #include "glcConfigListWGL.hpp"
28 #include "qpDebugOut.h"
29 
30 namespace glcts
31 {
32 
getDefaultConfigList(tcu::Platform & platform,glu::ApiType type,ConfigList & configList)33 void getDefaultConfigList(tcu::Platform &platform, glu::ApiType type, ConfigList &configList)
34 {
35     try
36     {
37         getConfigListEGL(platform, type, configList);
38     }
39     catch (const std::exception &e)
40     {
41         qpPrintf("No EGL configs enumerated: %s\n", e.what());
42     }
43 
44     try
45     {
46         getConfigListWGL(platform, type, configList);
47     }
48     catch (const std::exception &e)
49     {
50         qpPrintf("No WGL configs enumerated: %s\n", e.what());
51     }
52 
53     if (configList.configs.empty())
54     {
55         qpPrintf("Warning: No configs enumerated, adding only default config!\n");
56         configList.configs.push_back(Config(CONFIGTYPE_DEFAULT, 0, SURFACETYPE_WINDOW));
57     }
58 }
59 
60 } // namespace glcts
61