src/third_party/angle/src/tests/gl_tests/OcclusionQueriesTest.cpp
// Test that blit should not be counted by occlusion query.
Test that blit should not be counted by occlusion query.
Test that blit should not be counted by occlusion query .
TEST_P(OcclusionQueriesTestES3, BlitNotCounted)
{
    ANGLE_SKIP_TEST_IF(IsD3D11());
    ANGLE_SKIP_TEST_IF(IsWindows() && IsAMD() && IsVulkan());
    constexpr GLuint kSize = 64;
    GLFramebuffer srcFbo;
    glBindFramebuffer(GL_FRAMEBUFFER, srcFbo);
    GLTexture srcTex;
    glBindTexture(GL_TEXTURE_2D, srcTex);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, kSize, kSize, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
    glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, srcTex, 0);
    GLFramebuffer dstFbo;
    glBindFramebuffer(GL_DRAW_FRAMEBUFFER, dstFbo);
    GLTexture dstTex;
    glBindTexture(GL_TEXTURE_2D, dstTex);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, kSize, kSize, 0, GL_RGB, GL_UNSIGNED_BYTE, nullptr);
    glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, dstTex, 0);
    GLuint query = 0;
    glGenQueriesEXT(1, &query);
    drawQuad(mProgram, essl1_shaders::PositionAttrib(), 0.8f, 0.5f);
    glBeginQueryEXT(GL_ANY_SAMPLES_PASSED_EXT, query);
    glBlitFramebuffer(0, 0, 64, 64, 64, 64, 0, 0, GL_COLOR_BUFFER_BIT, GL_LINEAR);
    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 ( OcclusionQueriesTestES3 , BlitNotCounted ) { ANGLE_SKIP_TEST_IF ( IsD3D11 ( ) ) ; ANGLE_SKIP_TEST_IF ( IsWindows ( ) && IsAMD ( ) && IsVulkan ( ) ) ; constexpr GLuint kSize = 64 ; GLFramebuffer srcFbo ; glBindFramebuffer ( GL_FRAMEBUFFER , srcFbo ) ; GLTexture srcTex ; glBindTexture ( GL_TEXTURE_2D , srcTex ) ; glTexImage2D ( GL_TEXTURE_2D , 0 , GL_RGBA , kSize , kSize , 0 , GL_RGBA , GL_UNSIGNED_BYTE , nullptr ) ; glFramebufferTexture2D ( GL_FRAMEBUFFER , GL_COLOR_ATTACHMENT0 , GL_TEXTURE_2D , srcTex , 0 ) ; GLFramebuffer dstFbo ; glBindFramebuffer ( GL_DRAW_FRAMEBUFFER , dstFbo ) ; GLTexture dstTex ; glBindTexture ( GL_TEXTURE_2D , dstTex ) ; glTexImage2D ( GL_TEXTURE_2D , 0 , GL_RGB , kSize , kSize , 0 , GL_RGB , GL_UNSIGNED_BYTE , nullptr ) ; glFramebufferTexture2D ( GL_DRAW_FRAMEBUFFER , GL_COLOR_ATTACHMENT0 , GL_TEXTURE_2D , dstTex , 0 ) ; GLuint query = 0 ; glGenQueriesEXT ( 1 , & query ) ; drawQuad ( mProgram , essl1_shaders :: PositionAttrib ( ) , 0.8f , 0.5f ) ; glBeginQueryEXT ( GL_ANY_SAMPLES_PASSED_EXT , query ) ; glBlitFramebuffer ( 0 , 0 , 64 , 64 , 64 , 64 , 0 , 0 , GL_COLOR_BUFFER_BIT , GL_LINEAR ) ; 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 blit should not be counted by occlusion query.
Test that blit should not be counted by occlusion query .
// http://anglebug.com/4925 // http://anglebug.com/5101 // Unrelated draw before the query starts. // Blit flipped and with different formats. // will block waiting for result