Commit d61595f3 by Hernan Liatis

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/+/31152Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarHernan Liatis <hliatis@google.com>
parent e2242e5f
......@@ -209,6 +209,11 @@ void Queue::garbageCollect()
#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();
......
......@@ -2677,6 +2677,11 @@ VKAPI_ATTR VkResult VKAPI_CALL vkQueueSignalReleaseImageANDROID(VkQueue queue, u
TRACE("(VkQueue queue = %p, uint32_t waitSemaphoreCount = %d, const VkSemaphore* pWaitSemaphores = %p, VkImage image = %p, int* pNativeFenceFd = %p)",
queue, waitSemaphoreCount, pWaitSemaphores, image.get(), pNativeFenceFd);
// 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
vkQueueWaitIdle(queue);
GrallocModule* grallocMod = GrallocModule::getInstance();
void* nativeBuffer;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment