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, SampleFromRGBTextureDoesNotBreakRenderPass)
{
    const rx::vk::PerfCounters &counters = hackANGLE();
    ANGLE_GL_PROGRAM(program, essl1_shaders::vs::Texture2D(), essl1_shaders::fs::Texture2D());
    glUseProgram(program);
    GLint textureLoc = glGetUniformLocation(program, essl1_shaders::Texture2DUniform());
    ASSERT_NE(-1, textureLoc);
    GLTexture textureRGBA;
    glActiveTexture(GL_TEXTURE0);
    glBindTexture(GL_TEXTURE_2D, textureRGBA);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    GLTexture textureRGB;
    glActiveTexture(GL_TEXTURE1);
    glBindTexture(GL_TEXTURE_2D, textureRGB);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 2, 2, 0, GL_RGB, GL_UNSIGNED_BYTE, nullptr);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 1, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, nullptr);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    uint32_t expectedRenderPassCount = counters.renderPasses + 1;
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glUniform1i(textureLoc, 0);
    drawQuad(program, essl1_shaders::PositionAttrib(), 0.5f);
    ASSERT_GL_NO_ERROR();
    glUniform1i(textureLoc, 1);
    drawQuad(program, essl1_shaders::PositionAttrib(), 0.5f);
    ASSERT_GL_NO_ERROR();
    uint32_t actualRenderPassCount = counters.renderPasses;
    EXPECT_EQ(expectedRenderPassCount, actualRenderPassCount);
}
TEST_P ( VulkanPerformanceCounterTest , SampleFromRGBTextureDoesNotBreakRenderPass ) { const rx :: vk :: PerfCounters & counters = hackANGLE ( ) ; ANGLE_GL_PROGRAM ( program , essl1_shaders :: vs :: Texture2D ( ) , essl1_shaders :: fs :: Texture2D ( ) ) ; glUseProgram ( program ) ; GLint textureLoc = glGetUniformLocation ( program , essl1_shaders :: Texture2DUniform ( ) ) ; ASSERT_NE ( -1 , textureLoc ) ; GLTexture textureRGBA ; glActiveTexture ( GL_TEXTURE0 ) ; glBindTexture ( GL_TEXTURE_2D , textureRGBA ) ; glTexImage2D ( GL_TEXTURE_2D , 0 , GL_RGBA , 2 , 2 , 0 , GL_RGBA , GL_UNSIGNED_BYTE , nullptr ) ; glTexImage2D ( GL_TEXTURE_2D , 0 , GL_RGBA , 1 , 1 , 0 , GL_RGBA , GL_UNSIGNED_BYTE , nullptr ) ; glTexParameteri ( GL_TEXTURE_2D , GL_TEXTURE_MIN_FILTER , GL_LINEAR_MIPMAP_LINEAR ) ; glTexParameteri ( GL_TEXTURE_2D , GL_TEXTURE_MAG_FILTER , GL_LINEAR ) ; GLTexture textureRGB ; glActiveTexture ( GL_TEXTURE1 ) ; glBindTexture ( GL_TEXTURE_2D , textureRGB ) ; glTexImage2D ( GL_TEXTURE_2D , 0 , GL_RGB , 2 , 2 , 0 , GL_RGB , GL_UNSIGNED_BYTE , nullptr ) ; glTexImage2D ( GL_TEXTURE_2D , 0 , GL_RGB , 1 , 1 , 0 , GL_RGB , GL_UNSIGNED_BYTE , nullptr ) ; glTexParameteri ( GL_TEXTURE_2D , GL_TEXTURE_MIN_FILTER , GL_LINEAR_MIPMAP_LINEAR ) ; glTexParameteri ( GL_TEXTURE_2D , GL_TEXTURE_MAG_FILTER , GL_LINEAR ) ; uint32_t expectedRenderPassCount = counters . renderPasses + 1 ; glClear ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ) ; glUniform1i ( textureLoc , 0 ) ; drawQuad ( program , essl1_shaders :: PositionAttrib ( ) , 0.5f ) ; ASSERT_GL_NO_ERROR ( ) ; glUniform1i ( textureLoc , 1 ) ; drawQuad ( program , essl1_shaders :: PositionAttrib ( ) , 0.5f ) ; ASSERT_GL_NO_ERROR ( ) ; 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 .
// First draw with textureRGBA which should start the renderpass // Next draw with textureRGB which should not end the renderpass