src/third_party/angle/src/tests/gl_tests/VulkanPerformanceCounterTest.cpp
// Tests that another case does not break render pass, and that counts are correct:
//
// - Scenario: invalidate, draw
Tests that another case does not break render pass, and that counts are correct:
Scenario: invalidate, draw
Tests that another case does not break render pass and that counts are correct : Scenario : invalidate draw
TEST_P(VulkanPerformanceCounterTest, InvalidateDraw)
{
    const rx::vk::PerfCounters &counters = hackANGLE();
    rx::vk::PerfCounters expected;
    setExpectedCountersForInvalidateTest(counters, 1, 1, 0, 1, 0, 0, 0, &expected);
    ANGLE_GL_PROGRAM(program, essl1_shaders::vs::Simple(), essl1_shaders::fs::Red());
    GLFramebuffer framebuffer;
    GLTexture texture;
    GLRenderbuffer renderbuffer;
    setupClearAndDrawForInvalidateTest(&program, &framebuffer, &texture, &renderbuffer, false);
    const GLenum discards[] = {GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENT};
    glInvalidateFramebuffer(GL_FRAMEBUFFER, 2, discards);
    ASSERT_GL_NO_ERROR();
    drawQuad(program, essl1_shaders::PositionAttrib(), 0.5f);
    ASSERT_GL_NO_ERROR();
    EXPECT_EQ(expected.renderPasses, counters.renderPasses);
    swapBuffers();
    compareDepthStencilCountersForInvalidateTest(counters, expected);
    setAndIncrementLoadCountersForInvalidateTest(counters, 1, 0, &expected);
    drawQuad(program, essl1_shaders::PositionAttrib(), 0.5f);
    ASSERT_GL_NO_ERROR();
    swapBuffers();
    compareLoadCountersForInvalidateTest(counters, expected);
}
TEST_P ( VulkanPerformanceCounterTest , InvalidateDraw ) { const rx :: vk :: PerfCounters & counters = hackANGLE ( ) ; rx :: vk :: PerfCounters expected ; setExpectedCountersForInvalidateTest ( counters , 1 , 1 , 0 , 1 , 0 , 0 , 0 , & expected ) ; ANGLE_GL_PROGRAM ( program , essl1_shaders :: vs :: Simple ( ) , essl1_shaders :: fs :: Red ( ) ) ; GLFramebuffer framebuffer ; GLTexture texture ; GLRenderbuffer renderbuffer ; setupClearAndDrawForInvalidateTest ( & program , & framebuffer , & texture , & renderbuffer , false ) ; const GLenum discards [ ] = { GL_DEPTH_ATTACHMENT , GL_STENCIL_ATTACHMENT } ; glInvalidateFramebuffer ( GL_FRAMEBUFFER , 2 , discards ) ; ASSERT_GL_NO_ERROR ( ) ; drawQuad ( program , essl1_shaders :: PositionAttrib ( ) , 0.5f ) ; ASSERT_GL_NO_ERROR ( ) ; EXPECT_EQ ( expected . renderPasses , counters . renderPasses ) ; swapBuffers ( ) ; compareDepthStencilCountersForInvalidateTest ( counters , expected ) ; setAndIncrementLoadCountersForInvalidateTest ( counters , 1 , 0 , & expected ) ; drawQuad ( program , essl1_shaders :: PositionAttrib ( ) , 0.5f ) ; ASSERT_GL_NO_ERROR ( ) ; swapBuffers ( ) ; compareLoadCountersForInvalidateTest ( counters , expected ) ; }
Tests that another case does not break render pass, and that counts are correct:
 Scenario: invalidate, draw
Tests that another case does not break render pass and that counts are correct : Scenario : invalidate draw
// Expect rpCount+1, depth(Clears+1, Loads+0, Stores+1), stencil(Clears+0, Load+0, Stores+0) // Execute the scenario that this test is for: // Invalidate (should result: in storeOp = DONT_CARE; mContentDefined = false) // Draw (since enabled, should result: in storeOp = STORE; mContentDefined = true) // Ensure that the render pass wasn't broken // Use swapBuffers and then check how many loads and stores were actually done // Start and end another render pass, to check that the load ops are as expected