src/third_party/angle/src/tests/gl_tests/DrawBuffersTest.cpp
// Test that clear works with gaps
Test that clear works with gaps
Test that clear works with gaps
TEST_P(DrawBuffersTest, ClearWithGaps)
{
    ANGLE_SKIP_TEST_IF(IsVulkan() && IsAndroid());
    ANGLE_SKIP_TEST_IF(!setupTest());
    glGetIntegerv(GL_MAX_DRAW_BUFFERS, &mMaxDrawBuffers);
    ASSERT_GE(mMaxDrawBuffers, 4);
    glBindTexture(GL_TEXTURE_2D, mTextures[0]);
    glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTextures[0], 0);
    glBindTexture(GL_TEXTURE_2D, mTextures[1]);
    glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT3, GL_TEXTURE_2D, mTextures[1], 0);
    const GLenum bufs[] = {GL_COLOR_ATTACHMENT0, GL_NONE, GL_NONE, GL_COLOR_ATTACHMENT3};
    bool flags[8] = {true, false, false, true};
    GLuint program;
    setupMRTProgram(flags, &program);
    setDrawBuffers(4, bufs);
    glClearColor(1.0f, 1.0f, 0.0f, 1.0f);
    glClear(GL_COLOR_BUFFER_BIT);
    glEnable(GL_BLEND);
    glBlendFunc(GL_ZERO, GL_ONE);
    drawQuad(program, positionAttrib(), 0.5);
    EXPECT_GL_NO_ERROR();
    verifyAttachment2DColor(0, mTextures[0], GL_TEXTURE_2D, 0, GLColor::yellow);
    verifyAttachment2DColor(3, mTextures[1], GL_TEXTURE_2D, 0, GLColor::yellow);
    EXPECT_GL_NO_ERROR();
}
TEST_P ( DrawBuffersTest , ClearWithGaps ) { ANGLE_SKIP_TEST_IF ( IsVulkan ( ) && IsAndroid ( ) ) ; ANGLE_SKIP_TEST_IF ( ! setupTest ( ) ) ; glGetIntegerv ( GL_MAX_DRAW_BUFFERS , & mMaxDrawBuffers ) ; ASSERT_GE ( mMaxDrawBuffers , 4 ) ; glBindTexture ( GL_TEXTURE_2D , mTextures [ 0 ] ) ; glFramebufferTexture2D ( GL_FRAMEBUFFER , GL_COLOR_ATTACHMENT0 , GL_TEXTURE_2D , mTextures [ 0 ] , 0 ) ; glBindTexture ( GL_TEXTURE_2D , mTextures [ 1 ] ) ; glFramebufferTexture2D ( GL_FRAMEBUFFER , GL_COLOR_ATTACHMENT3 , GL_TEXTURE_2D , mTextures [ 1 ] , 0 ) ; const GLenum bufs [ ] = { GL_COLOR_ATTACHMENT0 , GL_NONE , GL_NONE , GL_COLOR_ATTACHMENT3 } ; bool flags [ 8 ] = { true , false , false , true } ; GLuint program ; setupMRTProgram ( flags , & program ) ; setDrawBuffers ( 4 , bufs ) ; glClearColor ( 1.0f , 1.0f , 0.0f , 1.0f ) ; glClear ( GL_COLOR_BUFFER_BIT ) ; glEnable ( GL_BLEND ) ; glBlendFunc ( GL_ZERO , GL_ONE ) ; drawQuad ( program , positionAttrib ( ) , 0.5 ) ; EXPECT_GL_NO_ERROR ( ) ; verifyAttachment2DColor ( 0 , mTextures [ 0 ] , GL_TEXTURE_2D , 0 , GLColor :: yellow ) ; verifyAttachment2DColor ( 3 , mTextures [ 1 ] , GL_TEXTURE_2D , 0 , GLColor :: yellow ) ; EXPECT_GL_NO_ERROR ( ) ; }
Test that clear works with gaps
Test that clear works with gaps
// TODO(syoussefi): Qualcomm driver crashes in the presence of VK_ATTACHMENT_UNUSED. // http://anglebug.com/3423 // A bogus draw to make sure clears are done with a render pass in the Vulkan backend.