src/third_party/angle/src/tests/gl_tests/VulkanPerformanceCounterTest.cpp
// Tests that RGB texture should not break renderpass.
Tests that RGB texture should not break renderpass.
Tests that RGB texture should not break renderpass .
TEST_P(VulkanPerformanceCounterTest, renderToRGBTextureDoesNotBreakRenderPass)
{
    const rx::vk::PerfCounters &counters = hackANGLE();
    ANGLE_GL_PROGRAM(program, essl1_shaders::vs::Passthrough(), essl1_shaders::fs::UniformColor());
    glUseProgram(program);
    GLint colorUniformLocation =
        glGetUniformLocation(program, angle::essl1_shaders::ColorUniform());
    ASSERT_NE(-1, colorUniformLocation);
    ASSERT_GL_NO_ERROR();
    GLTexture textureRGB;
    glActiveTexture(GL_TEXTURE1);
    glBindTexture(GL_TEXTURE_2D, textureRGB);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 256, 256, 0, GL_RGB, GL_UNSIGNED_BYTE, nullptr);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    GLFramebuffer framebuffer;
    glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
    glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textureRGB, 0);
    ASSERT_GL_FRAMEBUFFER_COMPLETE(GL_FRAMEBUFFER);
    ASSERT_GL_NO_ERROR();
    uint32_t expectedRenderPassCount = counters.renderPasses + 1;
    glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
    glClearColor(0.0f, 1.0f, 0.0f, 1.0f);  
    glClear(GL_COLOR_BUFFER_BIT);
    glViewport(0, 0, 256, 256);
    glUniform4fv(colorUniformLocation, 1, GLColor::blue.toNormalizedVector().data());
    drawQuad(program, essl1_shaders::PositionAttrib(), 0.5f);
    uint32_t actualRenderPassCount = counters.renderPasses;
    EXPECT_EQ(expectedRenderPassCount, actualRenderPassCount);
}
TEST_P ( VulkanPerformanceCounterTest , renderToRGBTextureDoesNotBreakRenderPass ) { const rx :: vk :: PerfCounters & counters = hackANGLE ( ) ; ANGLE_GL_PROGRAM ( program , essl1_shaders :: vs :: Passthrough ( ) , essl1_shaders :: fs :: UniformColor ( ) ) ; glUseProgram ( program ) ; GLint colorUniformLocation = glGetUniformLocation ( program , angle :: essl1_shaders :: ColorUniform ( ) ) ; ASSERT_NE ( -1 , colorUniformLocation ) ; ASSERT_GL_NO_ERROR ( ) ; GLTexture textureRGB ; glActiveTexture ( GL_TEXTURE1 ) ; glBindTexture ( GL_TEXTURE_2D , textureRGB ) ; glTexImage2D ( GL_TEXTURE_2D , 0 , GL_RGB , 256 , 256 , 0 , GL_RGB , GL_UNSIGNED_BYTE , nullptr ) ; glTexParameteri ( GL_TEXTURE_2D , GL_TEXTURE_MIN_FILTER , GL_LINEAR ) ; glTexParameteri ( GL_TEXTURE_2D , GL_TEXTURE_MAG_FILTER , GL_LINEAR ) ; GLFramebuffer framebuffer ; glBindFramebuffer ( GL_FRAMEBUFFER , framebuffer ) ; glFramebufferTexture2D ( GL_FRAMEBUFFER , GL_COLOR_ATTACHMENT0 , GL_TEXTURE_2D , textureRGB , 0 ) ; ASSERT_GL_FRAMEBUFFER_COMPLETE ( GL_FRAMEBUFFER ) ; ASSERT_GL_NO_ERROR ( ) ; uint32_t expectedRenderPassCount = counters . renderPasses + 1 ; glBindFramebuffer ( GL_FRAMEBUFFER , framebuffer ) ; glClearColor ( 0.0f , 1.0f , 0.0f , 1.0f ) ; glClear ( GL_COLOR_BUFFER_BIT ) ; glViewport ( 0 , 0 , 256 , 256 ) ; glUniform4fv ( colorUniformLocation , 1 , GLColor :: blue . toNormalizedVector ( ) . data ( ) ) ; drawQuad ( program , essl1_shaders :: PositionAttrib ( ) , 0.5f ) ; uint32_t actualRenderPassCount = counters . renderPasses ; EXPECT_EQ ( expectedRenderPassCount , actualRenderPassCount ) ; }
Tests that RGB texture should not break renderpass.
Tests that RGB texture should not break renderpass .
// Draw into FBO // clear to green