src/third_party/angle/src/tests/gl_tests/VulkanPerformanceCounterTest.cpp
// Tests that masked color clears don't break the RP.
Tests that masked color clears don't break the RP.
Tests that masked color clears don ' t break the RP .
TEST_P(VulkanPerformanceCounterTest, MaskedColorClearDoesNotBreakRenderPass)
{
    const rx::vk::PerfCounters &counters = hackANGLE();
    GLTexture texture;
    glBindTexture(GL_TEXTURE_2D, texture);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 256, 256, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
    GLFramebuffer framebuffer;
    glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
    glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0);
    ASSERT_GL_FRAMEBUFFER_COMPLETE(GL_FRAMEBUFFER);
    ASSERT_GL_NO_ERROR();
    uint32_t expectedRenderPassCount = counters.renderPasses + 1;
    glClearColor(0.25f, 0.25f, 0.25f, 0.25f);
    glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_FALSE);
    glClear(GL_COLOR_BUFFER_BIT);
    glClearColor(0.5f, 0.5f, 0.5f, 0.5f);
    glColorMask(GL_FALSE, GL_TRUE, GL_FALSE, GL_FALSE);
    glClear(GL_COLOR_BUFFER_BIT);
    glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
    glColorMask(GL_FALSE, GL_FALSE, GL_TRUE, GL_FALSE);
    glClear(GL_COLOR_BUFFER_BIT);
    glClearColor(0.75f, 0.75f, 0.75f, 0.75f);
    glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE);
    glClear(GL_COLOR_BUFFER_BIT);
    uint32_t actualRenderPassCount = counters.renderPasses;
    EXPECT_EQ(expectedRenderPassCount, actualRenderPassCount);
    EXPECT_PIXEL_NEAR(0, 0, 63, 127, 255, 191, 1);
}
TEST_P ( VulkanPerformanceCounterTest , MaskedColorClearDoesNotBreakRenderPass ) { const rx :: vk :: PerfCounters & counters = hackANGLE ( ) ; GLTexture texture ; glBindTexture ( GL_TEXTURE_2D , texture ) ; glTexImage2D ( GL_TEXTURE_2D , 0 , GL_RGBA , 256 , 256 , 0 , GL_RGBA , GL_UNSIGNED_BYTE , nullptr ) ; GLFramebuffer framebuffer ; glBindFramebuffer ( GL_FRAMEBUFFER , framebuffer ) ; glFramebufferTexture2D ( GL_FRAMEBUFFER , GL_COLOR_ATTACHMENT0 , GL_TEXTURE_2D , texture , 0 ) ; ASSERT_GL_FRAMEBUFFER_COMPLETE ( GL_FRAMEBUFFER ) ; ASSERT_GL_NO_ERROR ( ) ; uint32_t expectedRenderPassCount = counters . renderPasses + 1 ; glClearColor ( 0.25f , 0.25f , 0.25f , 0.25f ) ; glColorMask ( GL_TRUE , GL_FALSE , GL_FALSE , GL_FALSE ) ; glClear ( GL_COLOR_BUFFER_BIT ) ; glClearColor ( 0.5f , 0.5f , 0.5f , 0.5f ) ; glColorMask ( GL_FALSE , GL_TRUE , GL_FALSE , GL_FALSE ) ; glClear ( GL_COLOR_BUFFER_BIT ) ; glClearColor ( 1.0f , 1.0f , 1.0f , 1.0f ) ; glColorMask ( GL_FALSE , GL_FALSE , GL_TRUE , GL_FALSE ) ; glClear ( GL_COLOR_BUFFER_BIT ) ; glClearColor ( 0.75f , 0.75f , 0.75f , 0.75f ) ; glColorMask ( GL_FALSE , GL_FALSE , GL_FALSE , GL_TRUE ) ; glClear ( GL_COLOR_BUFFER_BIT ) ; uint32_t actualRenderPassCount = counters . renderPasses ; EXPECT_EQ ( expectedRenderPassCount , actualRenderPassCount ) ; EXPECT_PIXEL_NEAR ( 0 , 0 , 63 , 127 , 255 , 191 , 1 ) ; }
Tests that masked color clears don't break the RP.
Tests that masked color clears don ' t break the RP .
// Mask color channels and clear the framebuffer multiple times.