Vulkan: Don't end RenderPass on DS feedback loops.
Instead of always switching the Framebuffer to mask out depth/stencil
loops we now switch the RenderPass to a "read-only" depth/stencil mode.
Reduces the RenderPass count in Manhattan from 18->15. There are still
a couple extra RenderPasses inserted that we can get rid. We can merge
a few RenderPasses by retroactively changing a started RenderPass to
"read-only" when there are no prior recorded depth writes or clears.
Also adds a test to count the number of RenderPasses ANGLE generates in
DS feedback loop situaions.
Bug: angleproject:4959
Change-Id: I1855a45959655fc27ccd47a3469c1c672fc8fd9e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2357973
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
diff --git a/src/tests/gl_tests/FramebufferTest.cpp b/src/tests/gl_tests/FramebufferTest.cpp
index b744fee..f2e3a4f 100644
--- a/src/tests/gl_tests/FramebufferTest.cpp
+++ b/src/tests/gl_tests/FramebufferTest.cpp
@@ -1655,9 +1655,8 @@
}
// Tests that we can support a feedback loop between a depth textures and the depth buffer.
-// Does not totally mirror the case used in Manhattan. The Manhattan case seems to handle
-// "clear" specially instead of rendering to depth in the same RP.
-TEST_P(FramebufferTest_ES3, DepthFeedbackLoopSupported)
+// The test emulates the read-only feedback loop in Manhattan.
+TEST_P(FramebufferTest_ES3, ReadOnlyDepthFeedbackLoopSupported)
{
// Feedback loops not supported on D3D11 and may not ever be.
ANGLE_SKIP_TEST_IF(IsD3D11());
@@ -1711,9 +1710,10 @@
glClearDepthf(0.5f);
glClear(GL_DEPTH_BUFFER_BIT);
- // Disable the depth mask. Although this does not remove the feedback loop as defined by the
+ // Disable depth. Although this does not remove the feedback loop as defined by the
// spec it mimics what gfxbench does in its rendering tests.
glDepthMask(false);
+ glDisable(GL_DEPTH_TEST);
// Verify we can sample the depth texture and get 0.5.
drawQuad(program, essl1_shaders::PositionAttrib(), 0.5);