xref: /aosp_15_r20/external/deqp/framework/egl/egluStaticESLibrary.cpp (revision 35238bce31c2a825756842865a792f8cf7f89930)
1*35238bceSAndroid Build Coastguard Worker /*-------------------------------------------------------------------------
2*35238bceSAndroid Build Coastguard Worker  * drawElements Quality Program Tester Core
3*35238bceSAndroid Build Coastguard Worker  * ----------------------------------------
4*35238bceSAndroid Build Coastguard Worker  *
5*35238bceSAndroid Build Coastguard Worker  * Copyright 2014 The Android Open Source Project
6*35238bceSAndroid Build Coastguard Worker  *
7*35238bceSAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
8*35238bceSAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
9*35238bceSAndroid Build Coastguard Worker  * You may obtain a copy of the License at
10*35238bceSAndroid Build Coastguard Worker  *
11*35238bceSAndroid Build Coastguard Worker  *      http://www.apache.org/licenses/LICENSE-2.0
12*35238bceSAndroid Build Coastguard Worker  *
13*35238bceSAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
14*35238bceSAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
15*35238bceSAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16*35238bceSAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
17*35238bceSAndroid Build Coastguard Worker  * limitations under the License.
18*35238bceSAndroid Build Coastguard Worker  *
19*35238bceSAndroid Build Coastguard Worker  *//*!
20*35238bceSAndroid Build Coastguard Worker  * \file
21*35238bceSAndroid Build Coastguard Worker  * \brief EGL common defines and types
22*35238bceSAndroid Build Coastguard Worker  *//*--------------------------------------------------------------------*/
23*35238bceSAndroid Build Coastguard Worker 
24*35238bceSAndroid Build Coastguard Worker #include "egluStaticESLibrary.hpp"
25*35238bceSAndroid Build Coastguard Worker #include "tcuFunctionLibrary.hpp"
26*35238bceSAndroid Build Coastguard Worker 
27*35238bceSAndroid Build Coastguard Worker #define STATIC_LIB_NONE 0
28*35238bceSAndroid Build Coastguard Worker #define STATIC_LIB_ES20 1
29*35238bceSAndroid Build Coastguard Worker #define STATIC_LIB_ES30 2
30*35238bceSAndroid Build Coastguard Worker #define STATIC_LIB_ES31 3
31*35238bceSAndroid Build Coastguard Worker #define STATIC_LIB_ES32 4
32*35238bceSAndroid Build Coastguard Worker 
33*35238bceSAndroid Build Coastguard Worker #if defined(DEQP_GLES32_DIRECT_LINK)
34*35238bceSAndroid Build Coastguard Worker #if (DE_OS == DE_OS_IOS)
35*35238bceSAndroid Build Coastguard Worker #include <OpenGLES/ES32/gl.h>
36*35238bceSAndroid Build Coastguard Worker #else
37*35238bceSAndroid Build Coastguard Worker #include <GLES3/gl32.h>
38*35238bceSAndroid Build Coastguard Worker #endif
39*35238bceSAndroid Build Coastguard Worker #define STATIC_LIB STATIC_LIB_ES32
40*35238bceSAndroid Build Coastguard Worker #elif defined(DEQP_GLES31_DIRECT_LINK)
41*35238bceSAndroid Build Coastguard Worker #if (DE_OS == DE_OS_IOS)
42*35238bceSAndroid Build Coastguard Worker #include <OpenGLES/ES31/gl.h>
43*35238bceSAndroid Build Coastguard Worker #else
44*35238bceSAndroid Build Coastguard Worker #include <GLES3/gl31.h>
45*35238bceSAndroid Build Coastguard Worker #endif
46*35238bceSAndroid Build Coastguard Worker #define STATIC_LIB STATIC_LIB_ES31
47*35238bceSAndroid Build Coastguard Worker #elif defined(DEQP_GLES3_DIRECT_LINK)
48*35238bceSAndroid Build Coastguard Worker #if (DE_OS == DE_OS_IOS)
49*35238bceSAndroid Build Coastguard Worker #include <OpenGLES/ES3/gl.h>
50*35238bceSAndroid Build Coastguard Worker #else
51*35238bceSAndroid Build Coastguard Worker #include <GLES3/gl3.h>
52*35238bceSAndroid Build Coastguard Worker #endif
53*35238bceSAndroid Build Coastguard Worker #define STATIC_LIB STATIC_LIB_ES30
54*35238bceSAndroid Build Coastguard Worker #elif defined(DEQP_GLES2_DIRECT_LINK)
55*35238bceSAndroid Build Coastguard Worker #if (DE_OS == DE_OS_IOS)
56*35238bceSAndroid Build Coastguard Worker #include <OpenGLES/ES2/gl.h>
57*35238bceSAndroid Build Coastguard Worker #else
58*35238bceSAndroid Build Coastguard Worker #include <GLES2/gl2.h>
59*35238bceSAndroid Build Coastguard Worker #endif
60*35238bceSAndroid Build Coastguard Worker #define STATIC_LIB STATIC_LIB_ES20
61*35238bceSAndroid Build Coastguard Worker #else
62*35238bceSAndroid Build Coastguard Worker #define STATIC_LIB STATIC_LIB_NONE
63*35238bceSAndroid Build Coastguard Worker #endif
64*35238bceSAndroid Build Coastguard Worker 
65*35238bceSAndroid Build Coastguard Worker namespace eglu
66*35238bceSAndroid Build Coastguard Worker {
67*35238bceSAndroid Build Coastguard Worker 
createStaticESLibrary(void)68*35238bceSAndroid Build Coastguard Worker tcu::FunctionLibrary *createStaticESLibrary(void)
69*35238bceSAndroid Build Coastguard Worker {
70*35238bceSAndroid Build Coastguard Worker #if (STATIC_LIB == STATIC_LIB_NONE)
71*35238bceSAndroid Build Coastguard Worker     return new tcu::StaticFunctionLibrary(DE_NULL, 0);
72*35238bceSAndroid Build Coastguard Worker #else
73*35238bceSAndroid Build Coastguard Worker     static const tcu::StaticFunctionLibrary::Entry s_functions[] = {
74*35238bceSAndroid Build Coastguard Worker #if (STATIC_LIB == STATIC_LIB_ES32)
75*35238bceSAndroid Build Coastguard Worker #include "egluStaticES32Library.inl"
76*35238bceSAndroid Build Coastguard Worker #elif (STATIC_LIB == STATIC_LIB_ES31)
77*35238bceSAndroid Build Coastguard Worker #include "egluStaticES31Library.inl"
78*35238bceSAndroid Build Coastguard Worker #elif (STATIC_LIB == STATIC_LIB_ES30)
79*35238bceSAndroid Build Coastguard Worker #include "egluStaticES30Library.inl"
80*35238bceSAndroid Build Coastguard Worker #elif (STATIC_LIB == STATIC_LIB_ES20)
81*35238bceSAndroid Build Coastguard Worker #include "egluStaticES20Library.inl"
82*35238bceSAndroid Build Coastguard Worker #else
83*35238bceSAndroid Build Coastguard Worker #error "Unknown STATIC_LIB value"
84*35238bceSAndroid Build Coastguard Worker #endif
85*35238bceSAndroid Build Coastguard Worker     };
86*35238bceSAndroid Build Coastguard Worker 
87*35238bceSAndroid Build Coastguard Worker     return new tcu::StaticFunctionLibrary(&s_functions[0], DE_LENGTH_OF_ARRAY(s_functions));
88*35238bceSAndroid Build Coastguard Worker #endif
89*35238bceSAndroid Build Coastguard Worker }
90*35238bceSAndroid Build Coastguard Worker 
91*35238bceSAndroid Build Coastguard Worker } // namespace eglu
92