xref: /aosp_15_r20/external/deqp/modules/egl/teglRenderCase.hpp (revision 35238bce31c2a825756842865a792f8cf7f89930)
1*35238bceSAndroid Build Coastguard Worker #ifndef _TEGLRENDERCASE_HPP
2*35238bceSAndroid Build Coastguard Worker #define _TEGLRENDERCASE_HPP
3*35238bceSAndroid Build Coastguard Worker /*-------------------------------------------------------------------------
4*35238bceSAndroid Build Coastguard Worker  * drawElements Quality Program EGL Module
5*35238bceSAndroid Build Coastguard Worker  * ---------------------------------------
6*35238bceSAndroid Build Coastguard Worker  *
7*35238bceSAndroid Build Coastguard Worker  * Copyright 2014 The Android Open Source Project
8*35238bceSAndroid Build Coastguard Worker  *
9*35238bceSAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
10*35238bceSAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
11*35238bceSAndroid Build Coastguard Worker  * You may obtain a copy of the License at
12*35238bceSAndroid Build Coastguard Worker  *
13*35238bceSAndroid Build Coastguard Worker  *      http://www.apache.org/licenses/LICENSE-2.0
14*35238bceSAndroid Build Coastguard Worker  *
15*35238bceSAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
16*35238bceSAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
17*35238bceSAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18*35238bceSAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
19*35238bceSAndroid Build Coastguard Worker  * limitations under the License.
20*35238bceSAndroid Build Coastguard Worker  *
21*35238bceSAndroid Build Coastguard Worker  *//*!
22*35238bceSAndroid Build Coastguard Worker  * \file
23*35238bceSAndroid Build Coastguard Worker  * \brief Base class for rendering tests.
24*35238bceSAndroid Build Coastguard Worker  *//*--------------------------------------------------------------------*/
25*35238bceSAndroid Build Coastguard Worker 
26*35238bceSAndroid Build Coastguard Worker #include "tcuDefs.hpp"
27*35238bceSAndroid Build Coastguard Worker #include "teglTestCase.hpp"
28*35238bceSAndroid Build Coastguard Worker #include "teglSimpleConfigCase.hpp"
29*35238bceSAndroid Build Coastguard Worker 
30*35238bceSAndroid Build Coastguard Worker #include <vector>
31*35238bceSAndroid Build Coastguard Worker 
32*35238bceSAndroid Build Coastguard Worker namespace deqp
33*35238bceSAndroid Build Coastguard Worker {
34*35238bceSAndroid Build Coastguard Worker namespace egl
35*35238bceSAndroid Build Coastguard Worker {
36*35238bceSAndroid Build Coastguard Worker 
37*35238bceSAndroid Build Coastguard Worker class RenderCase : public SimpleConfigCase
38*35238bceSAndroid Build Coastguard Worker {
39*35238bceSAndroid Build Coastguard Worker public:
40*35238bceSAndroid Build Coastguard Worker     RenderCase(EglTestContext &eglTestCtx, const char *name, const char *description, eglw::EGLint surfaceTypeMask,
41*35238bceSAndroid Build Coastguard Worker                const eglu::FilterList &filters);
42*35238bceSAndroid Build Coastguard Worker     virtual ~RenderCase(void);
43*35238bceSAndroid Build Coastguard Worker 
44*35238bceSAndroid Build Coastguard Worker protected:
45*35238bceSAndroid Build Coastguard Worker     struct Config
46*35238bceSAndroid Build Coastguard Worker     {
47*35238bceSAndroid Build Coastguard Worker         eglw::EGLConfig config;
48*35238bceSAndroid Build Coastguard Worker         eglw::EGLint surfaceTypeBit;
49*35238bceSAndroid Build Coastguard Worker         eglw::EGLint apiBits;
50*35238bceSAndroid Build Coastguard Worker 
Configdeqp::egl::RenderCase::Config51*35238bceSAndroid Build Coastguard Worker         Config(eglw::EGLConfig config_, eglw::EGLint surfaceTypeBit_, eglw::EGLint apiBits_)
52*35238bceSAndroid Build Coastguard Worker             : config(config_)
53*35238bceSAndroid Build Coastguard Worker             , surfaceTypeBit(surfaceTypeBit_)
54*35238bceSAndroid Build Coastguard Worker             , apiBits(apiBits_)
55*35238bceSAndroid Build Coastguard Worker         {
56*35238bceSAndroid Build Coastguard Worker         }
57*35238bceSAndroid Build Coastguard Worker     };
58*35238bceSAndroid Build Coastguard Worker 
59*35238bceSAndroid Build Coastguard Worker     virtual void executeForConfig(eglw::EGLDisplay display, eglw::EGLConfig config);
60*35238bceSAndroid Build Coastguard Worker     virtual void executeForSurface(eglw::EGLDisplay display, eglw::EGLSurface surface, const Config &config) = DE_NULL;
61*35238bceSAndroid Build Coastguard Worker 
62*35238bceSAndroid Build Coastguard Worker     eglw::EGLint m_surfaceTypeMask;
63*35238bceSAndroid Build Coastguard Worker };
64*35238bceSAndroid Build Coastguard Worker 
65*35238bceSAndroid Build Coastguard Worker class SingleContextRenderCase : public RenderCase
66*35238bceSAndroid Build Coastguard Worker {
67*35238bceSAndroid Build Coastguard Worker public:
68*35238bceSAndroid Build Coastguard Worker     SingleContextRenderCase(EglTestContext &eglTestCtx, const char *name, const char *description, eglw::EGLint apiMask,
69*35238bceSAndroid Build Coastguard Worker                             eglw::EGLint surfaceTypeMask, const eglu::FilterList &filters);
70*35238bceSAndroid Build Coastguard Worker     virtual ~SingleContextRenderCase(void);
71*35238bceSAndroid Build Coastguard Worker 
72*35238bceSAndroid Build Coastguard Worker protected:
73*35238bceSAndroid Build Coastguard Worker     virtual void executeForSurface(eglw::EGLDisplay display, eglw::EGLSurface surface, const Config &config);
74*35238bceSAndroid Build Coastguard Worker     virtual void executeForContext(eglw::EGLDisplay display, eglw::EGLContext context, eglw::EGLSurface surface,
75*35238bceSAndroid Build Coastguard Worker                                    const Config &config) = DE_NULL;
76*35238bceSAndroid Build Coastguard Worker 
77*35238bceSAndroid Build Coastguard Worker     eglw::EGLint m_apiMask;
78*35238bceSAndroid Build Coastguard Worker };
79*35238bceSAndroid Build Coastguard Worker 
80*35238bceSAndroid Build Coastguard Worker class MultiContextRenderCase : public RenderCase
81*35238bceSAndroid Build Coastguard Worker {
82*35238bceSAndroid Build Coastguard Worker public:
83*35238bceSAndroid Build Coastguard Worker     MultiContextRenderCase(EglTestContext &eglTestCtx, const char *name, const char *description, eglw::EGLint api,
84*35238bceSAndroid Build Coastguard Worker                            eglw::EGLint surfaceType, const eglu::FilterList &filters, int numContextsPerApi);
85*35238bceSAndroid Build Coastguard Worker     virtual ~MultiContextRenderCase(void);
86*35238bceSAndroid Build Coastguard Worker 
87*35238bceSAndroid Build Coastguard Worker protected:
88*35238bceSAndroid Build Coastguard Worker     virtual void executeForSurface(eglw::EGLDisplay display, eglw::EGLSurface surface, const Config &config);
89*35238bceSAndroid Build Coastguard Worker     virtual void executeForContexts(eglw::EGLDisplay display, eglw::EGLSurface surface, const Config &config,
90*35238bceSAndroid Build Coastguard Worker                                     const std::vector<std::pair<eglw::EGLint, eglw::EGLContext>> &contexts) = DE_NULL;
91*35238bceSAndroid Build Coastguard Worker 
92*35238bceSAndroid Build Coastguard Worker     int m_numContextsPerApi;
93*35238bceSAndroid Build Coastguard Worker     eglw::EGLint m_apiMask;
94*35238bceSAndroid Build Coastguard Worker };
95*35238bceSAndroid Build Coastguard Worker 
96*35238bceSAndroid Build Coastguard Worker class RenderFilterList : public NamedFilterList
97*35238bceSAndroid Build Coastguard Worker {
98*35238bceSAndroid Build Coastguard Worker public:
RenderFilterList(const char * name,const char * description,eglw::EGLint surfaceTypeMask)99*35238bceSAndroid Build Coastguard Worker     RenderFilterList(const char *name, const char *description, eglw::EGLint surfaceTypeMask)
100*35238bceSAndroid Build Coastguard Worker         : NamedFilterList(name, description)
101*35238bceSAndroid Build Coastguard Worker         , m_surfaceTypeMask(surfaceTypeMask)
102*35238bceSAndroid Build Coastguard Worker     {
103*35238bceSAndroid Build Coastguard Worker     }
104*35238bceSAndroid Build Coastguard Worker 
getSurfaceTypeMask(void) const105*35238bceSAndroid Build Coastguard Worker     eglw::EGLint getSurfaceTypeMask(void) const
106*35238bceSAndroid Build Coastguard Worker     {
107*35238bceSAndroid Build Coastguard Worker         return m_surfaceTypeMask;
108*35238bceSAndroid Build Coastguard Worker     }
109*35238bceSAndroid Build Coastguard Worker 
110*35238bceSAndroid Build Coastguard Worker private:
111*35238bceSAndroid Build Coastguard Worker     eglw::EGLint m_surfaceTypeMask;
112*35238bceSAndroid Build Coastguard Worker };
113*35238bceSAndroid Build Coastguard Worker 
114*35238bceSAndroid Build Coastguard Worker void getDefaultRenderFilterLists(std::vector<RenderFilterList> &configSets, const eglu::FilterList &baseFilters);
115*35238bceSAndroid Build Coastguard Worker 
116*35238bceSAndroid Build Coastguard Worker //! Client APIs supported in current build
117*35238bceSAndroid Build Coastguard Worker eglw::EGLint getBuildClientAPIMask(void);
118*35238bceSAndroid Build Coastguard Worker 
119*35238bceSAndroid Build Coastguard Worker } // namespace egl
120*35238bceSAndroid Build Coastguard Worker } // namespace deqp
121*35238bceSAndroid Build Coastguard Worker 
122*35238bceSAndroid Build Coastguard Worker #endif // _TEGLRENDERCASE_HPP
123