Commit 748ad200 by Nicolas Capens Committed by Nicolas Capens

Don't override vkQueuePresentKHR() failure codes with VK_SUBOPTIMAL_KHR

VK_SUBOPTIMAL_KHR is a success code so it should not override failure codes, but should not get replaced by a VK_SUCCESS result itself. Bug: b/144766511 Change-Id: Ie7721fb3afc36f0b15579deff79dc9bdc9146cd0 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/40308 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 023b8641
...@@ -235,11 +235,16 @@ VkResult Queue::present(const VkPresentInfoKHR *presentInfo) ...@@ -235,11 +235,16 @@ VkResult Queue::present(const VkPresentInfoKHR *presentInfo)
presentInfo->pResults[i] = perSwapchainResult; presentInfo->pResults[i] = perSwapchainResult;
} }
// Keep track of the worst result code. VK_SUBOPTIMAL_KHR is a success code so it should
// not override failure codes, but should not get replaced by a VK_SUCCESS result itself.
if(perSwapchainResult != VK_SUCCESS) if(perSwapchainResult != VK_SUCCESS)
{ {
if(commandResult == VK_SUCCESS || commandResult == VK_SUBOPTIMAL_KHR)
{
commandResult = perSwapchainResult; commandResult = perSwapchainResult;
} }
} }
}
return commandResult; return commandResult;
} }
......
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