Have final present function perform a VkQueueWaitIdle()
This is just a small hack to prevent screen tearing.
Later, we should properly implement VkSemaphore to
prevent this.
Bug: b/132458423
Change-Id: I825f100a73c4b5b9b909eba83552cbec51ff1792
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/31152
Reviewed-by: Alexis Hétu <sugoi@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Hernan Liatis <hliatis@google.com>
diff --git a/src/Vulkan/VkQueue.cpp b/src/Vulkan/VkQueue.cpp
index 037f347..23de338 100644
--- a/src/Vulkan/VkQueue.cpp
+++ b/src/Vulkan/VkQueue.cpp
@@ -209,6 +209,11 @@
#ifndef __ANDROID__
void Queue::present(const VkPresentInfoKHR* presentInfo)
{
+ // This is a hack to deal with screen tearing for now.
+ // Need to correctly implement threading using VkSemaphore
+ // to get rid of it. b/132458423
+ waitIdle();
+
for(uint32_t i = 0; i < presentInfo->waitSemaphoreCount; i++)
{
vk::Cast(presentInfo->pWaitSemaphores[i])->wait();