src/third_party/angle/src/tests/gl_tests/OcclusionQueriesTest.cpp
TEST_P(OcclusionQueriesTest, MaskedClearNotCounted)
{
    ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3 &&
                       !IsGLExtensionEnabled("GL_EXT_occlusion_query_boolean"));

    // http://anglebug.com/4925
    ANGLE_SKIP_TEST_IF(IsD3D());

    GLuint query = 0;
    glGenQueriesEXT(1, &query);

    // Masked clear
    glBeginQueryEXT(GL_ANY_SAMPLES_PASSED_EXT, query);
    glColorMask(GL_TRUE, GL_FALSE, GL_TRUE, GL_TRUE);
    glClear(GL_COLOR_BUFFER_BIT);
    glEndQueryEXT(GL_ANY_SAMPLES_PASSED_EXT);
    EXPECT_GL_NO_ERROR();

    swapBuffers();

    GLuint result = GL_TRUE;
    glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_EXT,
                           &result);  // will block waiting for result
    EXPECT_GL_NO_ERROR();

    glDeleteQueriesEXT(1, &query);

    EXPECT_GL_FALSE(result);
}
// Test that masked glClear should not be counted by occlusion query.
Test that masked glClear should not be counted by occlusion query.
Test that masked glClear should not be counted by occlusion query .
TEST_P(OcclusionQueriesTest, MaskedClearNotCounted)
{
    ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3 &&
                       !IsGLExtensionEnabled("GL_EXT_occlusion_query_boolean"));
    ANGLE_SKIP_TEST_IF(IsD3D());
    GLuint query = 0;
    glGenQueriesEXT(1, &query);
    glBeginQueryEXT(GL_ANY_SAMPLES_PASSED_EXT, query);
    glColorMask(GL_TRUE, GL_FALSE, GL_TRUE, GL_TRUE);
    glClear(GL_COLOR_BUFFER_BIT);
    glEndQueryEXT(GL_ANY_SAMPLES_PASSED_EXT);
    EXPECT_GL_NO_ERROR();
    swapBuffers();
    GLuint result = GL_TRUE;
    glGetQueryObjectuivEXT(query, GL_QUERY_RESULT_EXT,
                           &result);  
    EXPECT_GL_NO_ERROR();
    glDeleteQueriesEXT(1, &query);
    EXPECT_GL_FALSE(result);
}
TEST_P ( OcclusionQueriesTest , MaskedClearNotCounted ) { ANGLE_SKIP_TEST_IF ( getClientMajorVersion ( ) < 3 && ! IsGLExtensionEnabled ( " " ) ) ; ANGLE_SKIP_TEST_IF ( IsD3D ( ) ) ; GLuint query = 0 ; glGenQueriesEXT ( 1 , & query ) ; glBeginQueryEXT ( GL_ANY_SAMPLES_PASSED_EXT , query ) ; glColorMask ( GL_TRUE , GL_FALSE , GL_TRUE , GL_TRUE ) ; glClear ( GL_COLOR_BUFFER_BIT ) ; glEndQueryEXT ( GL_ANY_SAMPLES_PASSED_EXT ) ; EXPECT_GL_NO_ERROR ( ) ; swapBuffers ( ) ; GLuint result = GL_TRUE ; glGetQueryObjectuivEXT ( query , GL_QUERY_RESULT_EXT , & result ) ; EXPECT_GL_NO_ERROR ( ) ; glDeleteQueriesEXT ( 1 , & query ) ; EXPECT_GL_FALSE ( result ) ; }
Test that masked glClear should not be counted by occlusion query.
Test that masked glClear should not be counted by occlusion query .
// http://anglebug.com/4925 // Masked clear // will block waiting for result