blob: 551952bcf4f745bd960d3a7dc3b6f92618c07890 [file] [log] [blame]
Jarkko Poyry3c827362014-09-02 11:48:52 +03001#ifndef _TEGLRENDERCASE_HPP
2#define _TEGLRENDERCASE_HPP
3/*-------------------------------------------------------------------------
4 * drawElements Quality Program EGL Module
5 * ---------------------------------------
6 *
7 * Copyright 2014 The Android Open Source Project
8 *
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 *
21 *//*!
22 * \file
23 * \brief Base class for rendering tests.
Jarkko Poyry3c827362014-09-02 11:48:52 +030024 *//*--------------------------------------------------------------------*/
25
26#include "tcuDefs.hpp"
27#include "teglTestCase.hpp"
28#include "teglSimpleConfigCase.hpp"
29
30#include <vector>
31
32namespace deqp
33{
34namespace egl
35{
36
37class RenderCase : public SimpleConfigCase
38{
39public:
Mika Isojärvi43105a32015-04-14 11:52:21 -070040 RenderCase (EglTestContext& eglTestCtx, const char* name, const char* description, eglw::EGLint surfaceTypeMask, const eglu::FilterList& filters);
Pyry Haulos3c67e4f2014-12-19 15:45:39 -080041 virtual ~RenderCase (void);
Jarkko Poyry3c827362014-09-02 11:48:52 +030042
43protected:
Pyry Haulos3c67e4f2014-12-19 15:45:39 -080044 struct Config
45 {
46 eglw::EGLConfig config;
47 eglw::EGLint surfaceTypeBit;
48 eglw::EGLint apiBits;
Jarkko Poyry3c827362014-09-02 11:48:52 +030049
Pyry Haulos3c67e4f2014-12-19 15:45:39 -080050 Config (eglw::EGLConfig config_, eglw::EGLint surfaceTypeBit_, eglw::EGLint apiBits_)
51 : config (config_)
52 , surfaceTypeBit (surfaceTypeBit_)
53 , apiBits (apiBits_)
54 {
55 }
56 };
Jarkko Poyry3c827362014-09-02 11:48:52 +030057
Pyry Haulos3c67e4f2014-12-19 15:45:39 -080058 virtual void executeForConfig (eglw::EGLDisplay display, eglw::EGLConfig config);
Pyry Haulos3c67e4f2014-12-19 15:45:39 -080059 virtual void executeForSurface (eglw::EGLDisplay display, eglw::EGLSurface surface, const Config& config) = DE_NULL;
60
Pyry Haulos3c67e4f2014-12-19 15:45:39 -080061 eglw::EGLint m_surfaceTypeMask;
Jarkko Poyry3c827362014-09-02 11:48:52 +030062};
63
64class SingleContextRenderCase : public RenderCase
65{
66public:
Pyry Haulos3c67e4f2014-12-19 15:45:39 -080067 SingleContextRenderCase (EglTestContext& eglTestCtx, const char* name, const char* description, eglw::EGLint apiMask, eglw::EGLint surfaceTypeMask, const eglu::FilterList& filters);
Jarkko Poyry3c827362014-09-02 11:48:52 +030068 virtual ~SingleContextRenderCase (void);
69
70protected:
Pyry Haulos3c67e4f2014-12-19 15:45:39 -080071 virtual void executeForSurface (eglw::EGLDisplay display, eglw::EGLSurface surface, const Config& config);
Pyry Haulos3c67e4f2014-12-19 15:45:39 -080072 virtual void executeForContext (eglw::EGLDisplay display, eglw::EGLContext context, eglw::EGLSurface surface, const Config& config) = DE_NULL;
Mika Isojärvi43105a32015-04-14 11:52:21 -070073
74 eglw::EGLint m_apiMask;
Jarkko Poyry3c827362014-09-02 11:48:52 +030075};
76
77class MultiContextRenderCase : public RenderCase
78{
79public:
Pyry Haulos3c67e4f2014-12-19 15:45:39 -080080 MultiContextRenderCase (EglTestContext& eglTestCtx, const char* name, const char* description, eglw::EGLint api, eglw::EGLint surfaceType, const eglu::FilterList& filters, int numContextsPerApi);
81 virtual ~MultiContextRenderCase (void);
Jarkko Poyry3c827362014-09-02 11:48:52 +030082
83protected:
Mika Isojärvi43105a32015-04-14 11:52:21 -070084 virtual void executeForSurface (eglw::EGLDisplay display, eglw::EGLSurface surface, const Config& config);
Pyry Haulos3c67e4f2014-12-19 15:45:39 -080085 virtual void executeForContexts (eglw::EGLDisplay display, eglw::EGLSurface surface, const Config& config, const std::vector<std::pair<eglw::EGLint, eglw::EGLContext> >& contexts) = DE_NULL;
Jarkko Poyry3c827362014-09-02 11:48:52 +030086
Pyry Haulos3c67e4f2014-12-19 15:45:39 -080087 int m_numContextsPerApi;
Mika Isojärvi43105a32015-04-14 11:52:21 -070088 eglw::EGLint m_apiMask;
Jarkko Poyry3c827362014-09-02 11:48:52 +030089};
90
Pyry Haulos3c67e4f2014-12-19 15:45:39 -080091class RenderFilterList : public NamedFilterList
Jarkko Poyry3c827362014-09-02 11:48:52 +030092{
93public:
Pyry Haulos3c67e4f2014-12-19 15:45:39 -080094 RenderFilterList (const char* name, const char* description, eglw::EGLint surfaceTypeMask)
95 : NamedFilterList (name, description)
Jarkko Poyry3c827362014-09-02 11:48:52 +030096 , m_surfaceTypeMask (surfaceTypeMask)
97 {
98 }
99
Pyry Haulos3c67e4f2014-12-19 15:45:39 -0800100 eglw::EGLint getSurfaceTypeMask (void) const
Jarkko Poyry3c827362014-09-02 11:48:52 +0300101 {
102 return m_surfaceTypeMask;
103 }
104
105private:
Pyry Haulos3c67e4f2014-12-19 15:45:39 -0800106 eglw::EGLint m_surfaceTypeMask;
Jarkko Poyry3c827362014-09-02 11:48:52 +0300107};
108
Pyry Haulos3c67e4f2014-12-19 15:45:39 -0800109void getDefaultRenderFilterLists (std::vector<RenderFilterList>& configSets, const eglu::FilterList& baseFilters);
110
111//! Client APIs supported in current build
112eglw::EGLint getBuildClientAPIMask (void);
Jarkko Poyry3c827362014-09-02 11:48:52 +0300113
114} // egl
115} // deqp
116
117#endif // _TEGLRENDERCASE_HPP