src/third_party/angle/src/tests/gl_tests/DrawBuffersTest.cpp
// Test draw buffer state change followed clear
Test draw buffer state change followed clear
Test draw buffer state change followed clear
TEST_P(ColorMaskForDrawBuffersTest, Clear)
{
    ANGLE_SKIP_TEST_IF(!setupTest());
    setupColorMaskForDrawBuffersTest();
    drawBuffers[1] = GL_COLOR_ATTACHMENT1;
    setDrawBuffers(4, drawBuffers);
    GLfloat *clearColor = GLColor::blue.toNormalizedVector().data();
    glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
    glClear(GL_COLOR_BUFFER_BIT);
    verifyAttachment2DColor(0, mTextures[0], GL_TEXTURE_2D, 0, GLColor::red);
    verifyAttachment2DColor(1, mTextures[1], GL_TEXTURE_2D, 0, GLColor::blue);
    EXPECT_GL_NO_ERROR();
}
TEST_P ( ColorMaskForDrawBuffersTest , Clear ) { ANGLE_SKIP_TEST_IF ( ! setupTest ( ) ) ; setupColorMaskForDrawBuffersTest ( ) ; drawBuffers [ 1 ] = GL_COLOR_ATTACHMENT1 ; setDrawBuffers ( 4 , drawBuffers ) ; GLfloat * clearColor = GLColor :: blue . toNormalizedVector ( ) . data ( ) ; glClearColor ( clearColor [ 0 ] , clearColor [ 1 ] , clearColor [ 2 ] , clearColor [ 3 ] ) ; glClear ( GL_COLOR_BUFFER_BIT ) ; verifyAttachment2DColor ( 0 , mTextures [ 0 ] , GL_TEXTURE_2D , 0 , GLColor :: red ) ; verifyAttachment2DColor ( 1 , mTextures [ 1 ] , GL_TEXTURE_2D , 0 , GLColor :: blue ) ; EXPECT_GL_NO_ERROR ( ) ; }
Test draw buffer state change followed clear
Test draw buffer state change followed clear
// Clear attachment1. Buffer0 should retain red and buffer1 should be blue