Commit a59e70ec by AWoloszyn Committed by Andrew Woloszyn

Fix vkQueuePresentKHR is pResults is not null.

pResults was not getting filled in correctly. As per the spec: pResults is an array of VkResult typed elements with swapchainCount entries. Applications that do not need per-swapchain results can use NULL for pResults. If non-NULL, each entry in pResults will be set to the VkResult for presenting the swapchain corresponding to the same index in pSwapchains. Bug: b/144766511 Change-Id: I42fcb6d96218d4dbfa60e857226c0aed72e7d8ca Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/38369Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com> Presubmit-Ready: Chris Forbes <chrisforbes@google.com> Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Tested-by: 's avatarAndrew Woloszyn <awoloszyn@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent 8faa5d2e
...@@ -219,7 +219,7 @@ VkResult Queue::present(const VkPresentInfoKHR* presentInfo) ...@@ -219,7 +219,7 @@ 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();
...@@ -227,12 +227,16 @@ VkResult Queue::present(const VkPresentInfoKHR* presentInfo) ...@@ -227,12 +227,16 @@ VkResult Queue::present(const VkPresentInfoKHR* presentInfo)
for(uint32_t i = 0; i < presentInfo->swapchainCount; i++) for(uint32_t i = 0; i < presentInfo->swapchainCount; i++)
{ {
VkResult result = vk::Cast(presentInfo->pSwapchains[i])->present(presentInfo->pImageIndices[i]); VkResult res = vk::Cast(presentInfo->pSwapchains[i])->present(presentInfo->pImageIndices[i]);
if (result != VK_SUCCESS) if (presentInfo->pResults != nullptr)
return result; {
presentInfo->pResults[i] = res;
}
if (res != VK_SUCCESS)
result = res;
} }
return VK_SUCCESS; return result;
} }
#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