Synchronize at end of renderpass
Heavy-handed implementation of implicit or explicit VkSubpassDependency
to VK_SUBPASS_EXTERNAL after a subpass.
Fixes various test flake.
Test: dEQP-VK.glsl.derivate.*
Change-Id: I9cb60828e6aff344e28dd7a8e1a867b5c8a11c22
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27708
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
diff --git a/src/Vulkan/VkCommandBuffer.cpp b/src/Vulkan/VkCommandBuffer.cpp
index d6ef037..ff1dbd6 100644
--- a/src/Vulkan/VkCommandBuffer.cpp
+++ b/src/Vulkan/VkCommandBuffer.cpp
@@ -100,6 +100,10 @@
executionState.renderPass->end();
executionState.renderPass = nullptr;
executionState.renderPassFramebuffer = nullptr;
+
+ // Execute (implicit or explicit) VkSubpassDependency to VK_SUBPASS_EXTERNAL
+ // This is somewhat heavier than the actual ordering required.
+ executionState.renderer->synchronize();
}
private: