From 079ca561114713d31e05c4124b8daeef764cf9b8 Mon Sep 17 00:00:00 2001 From: Alexander Galazin Date: Wed, 16 Aug 2017 11:36:01 +0200 Subject: [PATCH] Run Draw*BaseVertex if EXT_draw_elements_base_vertex is present Draw*BaseVertex methods are enabled if the EXT_draw_elements_base_vertex extension is present Follow-up on 1b1ea05b Components: AOSP Affects: dEQP-GLES31.functional.draw_base_vertex.* Change-Id: If8a4860a956c771ec5ea3341e2227f437b12a286 --- modules/gles31/functional/es31fDrawElementsBaseVertexTests.cpp | 3 ++- modules/glshared/glsDrawTest.cpp | 9 ++++++++- modules/glshared/glsDrawTest.hpp | 6 ++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/modules/gles31/functional/es31fDrawElementsBaseVertexTests.cpp b/modules/gles31/functional/es31fDrawElementsBaseVertexTests.cpp index 7b47e13..7b68587 100644 --- a/modules/gles31/functional/es31fDrawElementsBaseVertexTests.cpp +++ b/modules/gles31/functional/es31fDrawElementsBaseVertexTests.cpp @@ -222,7 +222,8 @@ void VertexIDCase::init (void) m_method == gls::DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_RANGED_BASEVERTEX || m_method == gls::DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_INSTANCED_BASEVERTEX) { - TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(m_context.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a 3.2 context or higher context version."); + const bool supportsES32 = contextSupports(m_context.getRenderContext().getType(), glu::ApiType::es(3, 2)); + TCU_CHECK_AND_THROW(NotSupportedError, supportsES32 || m_context.getContextInfo().isExtensionSupported("GL_EXT_draw_elements_base_vertex"), "GL_EXT_draw_elements_base_vertex is not supported."); } m_testCtx.getLog() << TestLog::Message diff --git a/modules/glshared/glsDrawTest.cpp b/modules/glshared/glsDrawTest.cpp index 472c5ea..d4f10c2 100644 --- a/modules/glshared/glsDrawTest.cpp +++ b/modules/glshared/glsDrawTest.cpp @@ -43,6 +43,7 @@ #include "tcuFloat.hpp" #include "tcuTextureUtil.hpp" +#include "gluContextInfo.hpp" #include "gluPixelTransfer.hpp" #include "gluCallLogWrapper.hpp" @@ -3034,6 +3035,7 @@ static bool containsLineCases (const std::vector& m_specs) DrawTest::DrawTest (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const DrawTestSpec& spec, const char* name, const char* desc) : TestCase (testCtx, name, desc) , m_renderCtx (renderCtx) + , m_contextInfo (DE_NULL) , m_refBuffers (DE_NULL) , m_refContext (DE_NULL) , m_glesContext (DE_NULL) @@ -3051,6 +3053,7 @@ DrawTest::DrawTest (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, co DrawTest::DrawTest (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const char* name, const char* desc) : TestCase (testCtx, name, desc) , m_renderCtx (renderCtx) + , m_contextInfo (DE_NULL) , m_refBuffers (DE_NULL) , m_refContext (DE_NULL) , m_glesContext (DE_NULL) @@ -3130,6 +3133,7 @@ void DrawTest::init (void) m_maxDiffRed = deCeilFloatToInt32(256.0f * (6.0f / (float)(1 << m_renderCtx.getRenderTarget().getPixelFormat().redBits))); m_maxDiffGreen = deCeilFloatToInt32(256.0f * (6.0f / (float)(1 << m_renderCtx.getRenderTarget().getPixelFormat().greenBits))); m_maxDiffBlue = deCeilFloatToInt32(256.0f * (6.0f / (float)(1 << m_renderCtx.getRenderTarget().getPixelFormat().blueBits))); + m_contextInfo = glu::ContextInfo::create(m_renderCtx); } void DrawTest::deinit (void) @@ -3139,12 +3143,14 @@ void DrawTest::deinit (void) delete m_refBuffers; delete m_refContext; delete m_glesContext; + delete m_contextInfo; m_glArrayPack = DE_NULL; m_rrArrayPack = DE_NULL; m_refBuffers = DE_NULL; m_refContext = DE_NULL; m_glesContext = DE_NULL; + m_contextInfo = DE_NULL; } DrawTest::IterateResult DrawTest::iterate (void) @@ -3156,7 +3162,8 @@ DrawTest::IterateResult DrawTest::iterate (void) spec.drawMethod == DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_INSTANCED_BASEVERTEX || spec.drawMethod == DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_RANGED_BASEVERTEX) { - TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(m_renderCtx.getType(), glu::ApiType::es(3, 2)), "Tests requires a 3.2 context or higher context version."); + const bool supportsES32 = contextSupports(m_renderCtx.getType(), glu::ApiType::es(3, 2)); + TCU_CHECK_AND_THROW(NotSupportedError, supportsES32 || m_contextInfo->isExtensionSupported("GL_EXT_draw_elements_base_vertex"), "GL_EXT_draw_elements_base_vertex is not supported."); } const bool drawStep = (m_iteration % 2) == 0; diff --git a/modules/glshared/glsDrawTest.hpp b/modules/glshared/glsDrawTest.hpp index 5347269..8c04ef5 100644 --- a/modules/glshared/glsDrawTest.hpp +++ b/modules/glshared/glsDrawTest.hpp @@ -27,6 +27,11 @@ #include "tcuResultCollector.hpp" #include "gluRenderContext.hpp" +namespace glu +{ +class ContextInfo; +} + namespace sglr { @@ -259,6 +264,7 @@ private: glu::RenderContext& m_renderCtx; + glu::ContextInfo* m_contextInfo; sglr::ReferenceContextBuffers* m_refBuffers; sglr::ReferenceContext* m_refContext; sglr::Context* m_glesContext; -- 2.7.4