Report tests using Draw*BaseVertex as NotSupported
authorAlexander Galazin <alexander.galazin@arm.com>
Wed, 16 Aug 2017 09:36:01 +0000 (11:36 +0200)
committerChris Forbes <chrisforbes@google.com>
Wed, 3 Jan 2018 20:49:28 +0000 (20:49 +0000)
Draw*BaseVertex methods were added in GLES 3.2.
Report tests using these methods as NotSupported if
GLES 3.1 context is returned.

Components: AOSP

Affects: dEQP-GLES31.functional.draw_base_vertex.*

Bug: 70716326
Test: run on google devices

Change-Id: I87c918d5f66a0a5b547f8e625c662203a7f85048
(cherry picked from commit 1b1ea05b4e8d6e9dbb07187b0af6bc12c315fb4e)
Merged-In: 1b1ea05b4e8d6e9dbb07187b0af6bc12c315fb4e

modules/gles31/functional/es31fDrawElementsBaseVertexTests.cpp
modules/glshared/glsDrawTest.cpp

index 11764c1..7b47e13 100644 (file)
@@ -218,6 +218,13 @@ VertexIDCase::~VertexIDCase (void)
 
 void VertexIDCase::init (void)
 {
+       if (m_method == deqp::gls::DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_BASEVERTEX ||
+               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.");
+       }
+
        m_testCtx.getLog()      << TestLog::Message
                                                << "gl_VertexID should be the index of the vertex that is being passed to the shader. i.e. indices[i] + basevertex"
                                                << TestLog::EndMessage;
index 155bd35..472c5ea 100644 (file)
@@ -3150,10 +3150,18 @@ void DrawTest::deinit (void)
 DrawTest::IterateResult DrawTest::iterate (void)
 {
        const int                                       specNdx                 = (m_iteration / 2);
+       const DrawTestSpec&                     spec                    = m_specs[specNdx];
+
+       if (spec.drawMethod == DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_BASEVERTEX ||
+               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                                      drawStep                = (m_iteration % 2) == 0;
        const bool                                      compareStep             = (m_iteration % 2) == 1;
        const IterateResult                     iterateResult   = ((size_t)m_iteration + 1 == m_specs.size()*2) ? (STOP) : (CONTINUE);
-       const DrawTestSpec&                     spec                    = m_specs[specNdx];
        const bool                                      updateProgram   = (m_iteration == 0) || (drawStep && !checkSpecsShaderCompatible(m_specs[specNdx], m_specs[specNdx-1])); // try to use the same shader in all iterations
        IterationLogSectionEmitter      sectionEmitter  (m_testCtx.getLog(), specNdx, m_specs.size(), m_iteration_descriptions[specNdx], drawStep && m_specs.size()!=1);