diff options
author | Jason Ekstrand <[email protected]> | 2020-06-27 08:50:47 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-07-06 14:49:06 +0000 |
commit | b0bbb62325b829427d87acb25b00b3e0eb0343cb (patch) | |
tree | 9a452f66d2e78518d966c4a634ca4b8dd56672a1 /src/vulkan/wsi/wsi_common.c | |
parent | c5d8961b0b0724f561aadee441390627d93d3079 (diff) |
vulkan/wsi: Don't consider VK_SUBOPTIMAL_KHR to be an error condition
This was causing vkAcquireNextImageKHR to not signal the fences and
semaphores. In the case where the semaphore was brand new, this could
cause an unsignalled syncobj to be passed into execbuffer2 which it will
reject with -EINVAL leading to VK_ERROR_DEVICE_LOST. Thanks to Henrik
RydgÄrd who works on the PPSSPP project for helping me figure this out.
Fixes: ca3cfbf6f1e00 "vk: Add an initial implementation of the actual..."
Fixes: 778b51f491cfe "vulkan/wsi: Add a hooks for signaling semaphores..."
Reviewed-by: Lionel Landwerlin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5672>
Diffstat (limited to 'src/vulkan/wsi/wsi_common.c')
-rw-r--r-- | src/vulkan/wsi/wsi_common.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c index d9906091ed9..2108f7f703f 100644 --- a/src/vulkan/wsi/wsi_common.c +++ b/src/vulkan/wsi/wsi_common.c @@ -1100,7 +1100,7 @@ wsi_common_acquire_next_image2(const struct wsi_device *wsi, VkResult result = swapchain->acquire_next_image(swapchain, pAcquireInfo, pImageIndex); - if (result != VK_SUCCESS) + if (result != VK_SUCCESS && result != VK_SUBOPTIMAL_KHR) return result; if (wsi->set_memory_ownership) { @@ -1124,7 +1124,7 @@ wsi_common_acquire_next_image2(const struct wsi_device *wsi, image->memory); } - return VK_SUCCESS; + return result; } VkResult @@ -1226,7 +1226,7 @@ wsi_common_queue_present(const struct wsi_device *wsi, region = ®ions->pRegions[i]; result = swapchain->queue_present(swapchain, image_index, region); - if (result != VK_SUCCESS) + if (result != VK_SUCCESS && result != VK_SUBOPTIMAL_KHR) goto fail_present; if (wsi->set_memory_ownership) { |