Path: blob/main_old/src/tests/deqp_support/tes31Context_override.cpp
1693 views
//1// Copyright 2019 The ANGLE Project Authors. All rights reserved.2// Use of this source code is governed by a BSD-style license that can be3// found in the LICENSE file.4//5// tes31Context_override.cpp:6// Issue 3687: Overrides for dEQP's OpenGL ES 3.1 test context7//89// Keep the delta compared to dEQP at a minimum10// clang-format off1112#include "tes31Context.hpp"13#include "gluRenderConfig.hpp"14#include "gluFboRenderContext.hpp"15#include "gluContextInfo.hpp"16#include "gluDummyRenderContext.hpp"17#include "tcuCommandLine.hpp"1819namespace deqp20{21namespace gles3122{2324Context::Context (tcu::TestContext& testCtx, glu::ApiType apiType)25: m_testCtx (testCtx)26, m_renderCtx (DE_NULL)27, m_contextInfo (DE_NULL)28, m_apiType (apiType)29{30if (m_testCtx.getCommandLine().getRunMode() == tcu::RUNMODE_EXECUTE)31createRenderContext();32else33{34// \todo [2016-11-15 pyry] Many tests (erroneously) inspect context type35// during test hierarchy construction. We should fix that36// and revert dummy context to advertise unknown context type.37m_renderCtx = new glu::DummyRenderContext(glu::ContextType(glu::ApiType::es(3,1)));38}39}4041Context::~Context (void)42{43destroyRenderContext();44}4546void Context::createRenderContext (void)47{48DE_ASSERT(!m_renderCtx && !m_contextInfo);4950try51{5253// Issue 368754// OpenGL ES 3.2 contexts are not fully supported yet. Creating a 3.2 context results in a number of test55// failures as they assume the existence of extensions that are not supported.56// Revert with Issue 368857#if 058m_renderCtx = glu::createDefaultRenderContext(m_testCtx.getPlatform(), m_testCtx.getCommandLine(), m_apiType);59#else60// Override the original behavior (above) to create a 3.1 context61m_renderCtx = glu::createDefaultRenderContext(m_testCtx.getPlatform(), m_testCtx.getCommandLine(), glu::ApiType::es(3, 1));62#endif63m_contextInfo = glu::ContextInfo::create(*m_renderCtx);64}65catch (...)66{67destroyRenderContext();68throw;69}70}7172void Context::destroyRenderContext (void)73{74delete m_contextInfo;75delete m_renderCtx;7677m_contextInfo = DE_NULL;78m_renderCtx = DE_NULL;79}8081const tcu::RenderTarget& Context::getRenderTarget (void) const82{83return m_renderCtx->getRenderTarget();84}8586} // gles3187} // deqp8889// clang-format on909192