Edit

kc3-lang/angle/src/tests/gl_tests/AtomicCounterBufferTest.cpp

Branch :

  • Show log

    Commit

  • Author : Jiajia Qin
    Date : 2016-12-27 17:04:07
    Hash : 6eafb04c
    Message : ES31: Add GL_ATOMIC_COUNTER_BUFFER_BINDING binding point BUG=angleproject:1729 TEST=dEQP-GLES31.functional.state_query.integer.atomic_counter* dEQP-GLES31.functional.state_query.indexed.atomic_counter* angle_end2end_tests:AtomicCounterBufferTest Change-Id: I059c4e22e04cedec9134ec9f631de33f77b1fbe2 Reviewed-on: https://chromium-review.googlesource.com/430959 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>

  • src/tests/gl_tests/AtomicCounterBufferTest.cpp
  • //
    // Copyright 2017 The ANGLE Project Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style license that can be
    // found in the LICENSE file.
    //
    // AtomicCounterBufferTest:
    //   Various tests related for atomic counter buffers.
    //
    
    #include "test_utils/ANGLETest.h"
    #include "test_utils/gl_raii.h"
    
    using namespace angle;
    
    namespace
    {
    
    class AtomicCounterBufferTest : public ANGLETest
    {
      protected:
        AtomicCounterBufferTest()
        {
            setWindowWidth(128);
            setWindowHeight(128);
            setConfigRedBits(8);
            setConfigGreenBits(8);
            setConfigBlueBits(8);
            setConfigAlphaBits(8);
        }
    };
    
    // Test GL_ATOMIC_COUNTER_BUFFER is not supported with version lower than ES31.
    TEST_P(AtomicCounterBufferTest, AtomicCounterBufferBindings)
    {
        ASSERT_EQ(3, getClientMajorVersion());
        GLBuffer atomicCounterBuffer;
        glBindBufferBase(GL_ATOMIC_COUNTER_BUFFER, 1, atomicCounterBuffer.get());
        if (getClientMinorVersion() < 1)
        {
            EXPECT_GL_ERROR(GL_INVALID_ENUM);
        }
        else
        {
            EXPECT_GL_NO_ERROR();
        }
    }
    
    ANGLE_INSTANTIATE_TEST(AtomicCounterBufferTest,
                           ES3_OPENGL(),
                           ES3_OPENGLES(),
                           ES31_OPENGL(),
                           ES31_OPENGLES());
    
    }  // namespace