Vulkan: Dont break RP if there is actual render feedback loop There is a bit terminology confusion here that will be fixed in next CL. If a depth attachment is read only, then there is no feedback loop, we should not call feedback loop for read only depth attachment. The real depth render feedback loop mode is formed when we write to depth and sample from depth at the same time. In this condition, the content is undefined per OpenGLES spec section 9.3.1 (https://registry.khronos.org/OpenGL/specs/es/3.2/es_spec_3.2.pdf). The shouldSwitchToReadOnlyDepthStencilFeedbackLoopMode() implementation handles the usage case that the same render pass has depth write and then switch to read only. Under this usage there is no actual feedback loop, and we should still work properly by end current render pass and start a new render pass with read only depth attachment. This implementation also treating the actual feedback loop case exactly the same way by ending render pass first, even though this is undefined behavior. gangstar_vegas has the exact this undefined behavior usage case, where it write and sample from depth buffer at the same draw call. Native driver is not ending the render pass but ANGLE currently does. This puts ANGLE into worse performance. Since this is undefined behavior, either way is correct. This CL checks if there is an actual feedback loop in the current render pass and if yes, we adopt the native driver's behavior that keep the current render pass going. This improves gangstar_vegas frame time from 4.365ms to 3.89ms, and interestingly, yield the same golden image. Bug: b/289436017 Change-Id: Ifc04ecd8ad6455a88e8615bd5452b9cce88c6687 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4679361 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>