chromium/third_party/angle/src/tests/gl_tests/OcclusionQueriesTest.cpp

//
// Copyright 2015 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.
//

#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
#include "util/EGLWindow.h"
#include "util/random_utils.h"
#include "util/test_utils.h"

usingnamespaceangle;

class OcclusionQueriesTest : public ANGLETest<>
{};

class OcclusionQueriesTestES3 : public OcclusionQueriesTest
{};

TEST_P(OcclusionQueriesTest, IsOccluded)
{}

TEST_P(OcclusionQueriesTest, IsNotOccluded)
{}

// Test that glClear should not be counted by occlusion query.
TEST_P(OcclusionQueriesTest, ClearNotCounted)
{}

// Test that masked glClear should not be counted by occlusion query.
TEST_P(OcclusionQueriesTest, MaskedClearNotCounted)
{}

// Test that copies should not be counted by occlusion query.
TEST_P(OcclusionQueriesTest, CopyNotCounted)
{}

// Test that blit should not be counted by occlusion query.
TEST_P(OcclusionQueriesTestES3, BlitNotCounted)
{}

// Test that multisampled-render-to-texture unresolve should not be counted by occlusion query.
TEST_P(OcclusionQueriesTestES3, UnresolveNotCounted)
{}

// Test that reusing a query should reset its value to zero if no draw calls are emitted in the
// second pass.
TEST_P(OcclusionQueriesTest, RewriteDrawNoDrawToZero)
{}

// Test that changing framebuffers work
TEST_P(OcclusionQueriesTest, FramebufferBindingChange)
{}

// Test that switching framebuffers without actually drawing, then issuing a masked clear while a
// query is active works.
TEST_P(OcclusionQueriesTestES3, SwitchFramebuffersThenMaskedClear)
{}

// Test that an empty query after a positive query returns false
TEST_P(OcclusionQueriesTest, EmptyQueryAfterCompletedQuery)
{}

// Some Metal drivers do not automatically clear visibility buffer
// at the beginning of a render pass. This test makes two queries
// that would use the same internal visibility buffer at the same
// offset and checks the query results.
TEST_P(OcclusionQueriesTest, EmptyQueryAfterCompletedQueryInterleaved)
{}

// Test multiple occlusion queries.
TEST_P(OcclusionQueriesTest, MultiQueries)
{}

TEST_P(OcclusionQueriesTest, Errors)
{}

// Test that running multiple simultaneous queries from multiple EGL contexts returns the correct
// result for each query.  Helps expose bugs in ANGLE's virtual contexts.
TEST_P(OcclusionQueriesTest, MultiContext)
{}

class OcclusionQueriesNoSurfaceTestES3 : public ANGLETestBase,
                                         public ::testing::TestWithParam<angle::PlatformParameters>
{};

// This test provked a bug in the Metal backend that only happened
// when there was no surfaces on the EGLContext and a query had
// just ended after a draw and then switching to a different
// context.
TEST_P(OcclusionQueriesNoSurfaceTestES3, SwitchingContextsWithQuery)
{}

ANGLE_INSTANTIATE_TEST_ES2_AND_ES3();

GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST();
ANGLE_INSTANTIATE_TEST_ES3_AND();

GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST();
ANGLE_INSTANTIATE_TEST_ES3();