src/third_party/angle/src/tests/gl_tests/OcclusionQueriesTest.cpp
// Test that copies should not be counted by occlusion query.
Test that copies should not be counted by occlusion query.
Test that copies should not be counted by occlusion query .
TEST_P(OcclusionQueriesTest, CopyNotCounted)
{
    ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3 &&
                       !IsGLExtensionEnabled("GL_EXT_occlusion_query_boolean"));
    ANGLE_SKIP_TEST_IF(IsD3D());
    ANGLE_SKIP_TEST_IF(IsMetal());
    GLuint query = 0;
    glGenQueriesEXT(1, &query);
    drawQuad(mProgram, essl1_shaders::PositionAttrib(), 0.8f, 0.5f);
    glBeginQueryEXT(GL_ANY_SAMPLES_PASSED_EXT, query);
    GLTexture tex;
    glBindTexture(GL_TEXTURE_2D, tex);
    glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, getWindowWidth(), getWindowHeight(), 0);
    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 , CopyNotCounted ) { ANGLE_SKIP_TEST_IF ( getClientMajorVersion ( ) < 3 && ! IsGLExtensionEnabled ( " " ) ) ; ANGLE_SKIP_TEST_IF ( IsD3D ( ) ) ; ANGLE_SKIP_TEST_IF ( IsMetal ( ) ) ; GLuint query = 0 ; glGenQueriesEXT ( 1 , & query ) ; drawQuad ( mProgram , essl1_shaders :: PositionAttrib ( ) , 0.8f , 0.5f ) ; glBeginQueryEXT ( GL_ANY_SAMPLES_PASSED_EXT , query ) ; GLTexture tex ; glBindTexture ( GL_TEXTURE_2D , tex ) ; glCopyTexImage2D ( GL_TEXTURE_2D , 0 , GL_RGB , 0 , 0 , getWindowWidth ( ) , getWindowHeight ( ) , 0 ) ; 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 copies should not be counted by occlusion query.
Test that copies should not be counted by occlusion query .
// http://anglebug.com/4925 // http://anglebug.com/5100 // Unrelated draw before the query starts. // Copy to a texture with a different format from backbuffer // will block waiting for result