1 #ifndef _GLSFBOCOMPLETENESSTESTS_HPP
2 #define _GLSFBOCOMPLETENESSTESTS_HPP
4 /*-------------------------------------------------------------------------
5 * drawElements Quality Program OpenGL (ES) Module
6 * -----------------------------------------------
8 * Copyright 2014 The Android Open Source Project
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
14 * http://www.apache.org/licenses/LICENSE-2.0
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.
24 * \brief Common parts for ES2/3 framebuffer completeness tests.
25 *//*--------------------------------------------------------------------*/
27 #include "tcuTestCase.hpp"
28 #include "gluRenderContext.hpp"
29 #include "glsFboUtil.hpp"
30 #include "glwDefs.hpp"
31 #include "glwEnums.hpp"
32 #include "tcuTestCase.hpp"
33 #include "tcuTestLog.hpp"
45 using glu::RenderContext;
47 using tcu::TestContext;
48 typedef TestCase::IterateResult IterateResult;
49 using tcu::TestCaseGroup;
54 using namespace deqp::gls::FboUtil;
55 using namespace deqp::gls::FboUtil::config;
60 Context (TestContext& testCtx,
61 RenderContext& renderCtx,
62 CheckerFactory& factory);
63 RenderContext& getRenderContext (void) const { return m_renderCtx; }
64 TestContext& getTestContext (void) const { return m_testCtx; }
65 const FboVerifier& getVerifier (void) const { return m_verifier; }
66 const FormatDB& getCoreFormats (void) const { return m_coreFormats; }
67 const FormatDB& getCtxFormats (void) const { return m_ctxFormats; }
68 const FormatDB& getAllFormats (void) const { return m_allFormats; }
69 bool haveMultiColorAtts (void) const { return m_haveMultiColorAtts; }
70 void setHaveMulticolorAtts (bool have) { m_haveMultiColorAtts = have; }
71 void addFormats (FormatEntries fmtRange);
72 void addExtFormats (FormatExtEntries extRange);
73 TestCaseGroup* createRenderableTests (void);
74 TestCaseGroup* createAttachmentTests (void);
75 TestCaseGroup* createSizeTests (void);
77 TestContext& m_testCtx;
78 RenderContext& m_renderCtx;
79 FormatDB m_coreFormats;
80 FormatDB m_ctxFormats;
81 FormatDB m_allFormats;
82 FboVerifier m_verifier;
83 bool m_haveMultiColorAtts;
86 class TestBase : public TestCase
89 Context& getContext (void) const { return m_ctx; }
93 TestBase (Context& ctx,
94 const string& name, const string& desc)
95 : TestCase (ctx.getTestContext(),
96 name.c_str(), desc.c_str())
98 void fail (const char* msg);
99 void qualityWarning (const char* msg);
101 void checkFbo (FboBuilder& builder);
102 ImageFormat getDefaultFormat (GLenum attPoint, GLenum bufType) const;
104 IterateResult iterate (void);
106 virtual IterateResult build (FboBuilder& builder);
108 void attachTargetToNew (GLenum target, GLenum bufType,
110 GLsizei width, GLsizei height,
111 FboBuilder& builder);
115 // Utilities for building
116 Image* makeImage (GLenum bufType, ImageFormat format,
117 GLsizei width, GLsizei height, FboBuilder& builder);
118 Attachment* makeAttachment (GLenum bufType, ImageFormat format,
119 GLsizei width, GLsizei height, FboBuilder& builder);
121 template <typename P>
122 class ParamTest : public TestBase
126 ParamTest (Context& ctx, const Params& params)
127 : TestBase (ctx, Params::getName(params), Params::getDescription(params))
128 , m_params (params) {}
135 const glw::Functions& gl (const TestBase& test);
139 using details::Context;
140 using details::TestBase;
141 using details::ParamTest;
148 #endif // _GLSFBOCOMPLETENESSTESTS_HPP