Commit 023b8641 by Nicolas Capens Committed by Nicolas Capens

Discern between per-swapchain and vkQueuePresent command results

Bug: b/144766511 Change-Id: I83da9b20422ef546fcc8fa27cd8d17399b275345 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/40290 Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 02a39536
...@@ -218,24 +218,30 @@ VkResult Queue::present(const VkPresentInfoKHR *presentInfo) ...@@ -218,24 +218,30 @@ VkResult Queue::present(const VkPresentInfoKHR *presentInfo)
// Need to correctly implement threading using VkSemaphore // Need to correctly implement threading using VkSemaphore
// to get rid of it. b/132458423 // to get rid of it. b/132458423
waitIdle(); waitIdle();
VkResult result = VK_SUCCESS;
for(uint32_t i = 0; i < presentInfo->waitSemaphoreCount; i++) for(uint32_t i = 0; i < presentInfo->waitSemaphoreCount; i++)
{ {
vk::Cast(presentInfo->pWaitSemaphores[i])->wait(); vk::Cast(presentInfo->pWaitSemaphores[i])->wait();
} }
VkResult commandResult = VK_SUCCESS;
for(uint32_t i = 0; i < presentInfo->swapchainCount; i++) for(uint32_t i = 0; i < presentInfo->swapchainCount; i++)
{ {
VkResult res = vk::Cast(presentInfo->pSwapchains[i])->present(presentInfo->pImageIndices[i]); VkResult perSwapchainResult = vk::Cast(presentInfo->pSwapchains[i])->present(presentInfo->pImageIndices[i]);
if(presentInfo->pResults != nullptr)
if(presentInfo->pResults)
{
presentInfo->pResults[i] = perSwapchainResult;
}
if(perSwapchainResult != VK_SUCCESS)
{ {
presentInfo->pResults[i] = res; commandResult = perSwapchainResult;
} }
if(res != VK_SUCCESS)
result = res;
} }
return result; return commandResult;
} }
#endif #endif
......
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