summaryrefslogtreecommitdiffstats
path: root/src/intel
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2017-02-10 17:54:12 +0000
committerEmil Velikov <[email protected]>2017-02-23 19:34:59 +0000
commit173a2ab5c7db6e54f04c17fd86b0e36b4966bdcc (patch)
tree4dc89284c74746fc794c4a2d33d738b5859fac57 /src/intel
parent3c93076e8c4e1f1bc8f57d0c3bb853d4f4328cda (diff)
anv: wsi: report presentation error per image request
vkQueuePresentKHR() takes VkPresentInfoKHR pointer and includes a pResults fields which must holds the results of all the images requested to be presented. Currently we're not filling this field. Also as a side effect we probably want to go through all the images rather than stopping on the first error. This commit also makes the QueuePresentKHR() implementation return the first error encountered. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Cc: "17.0" <[email protected]> (cherry picked from commit 0fcb92c17dee681bd39c08ddf0abc358a27337c7)
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/vulkan/anv_wsi.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c
index a01ef03c11b..3a366988de8 100644
--- a/src/intel/vulkan/anv_wsi.c
+++ b/src/intel/vulkan/anv_wsi.c
@@ -350,21 +350,25 @@ VkResult anv_QueuePresentKHR(
const VkPresentInfoKHR* pPresentInfo)
{
ANV_FROM_HANDLE(anv_queue, queue, _queue);
- VkResult result;
+ VkResult result = VK_SUCCESS;
for (uint32_t i = 0; i < pPresentInfo->swapchainCount; i++) {
ANV_FROM_HANDLE(wsi_swapchain, swapchain, pPresentInfo->pSwapchains[i]);
+ VkResult item_result;
assert(anv_device_from_handle(swapchain->device) == queue->device);
if (swapchain->fences[0] == VK_NULL_HANDLE) {
- result = anv_CreateFence(anv_device_to_handle(queue->device),
+ item_result = anv_CreateFence(anv_device_to_handle(queue->device),
&(VkFenceCreateInfo) {
.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
.flags = 0,
}, &swapchain->alloc, &swapchain->fences[0]);
- if (result != VK_SUCCESS)
- return result;
+ if (pPresentInfo->pResults != NULL)
+ pPresentInfo->pResults[i] = item_result;
+ result = result == VK_SUCCESS ? item_result : result;
+ if (item_result != VK_SUCCESS)
+ continue;
} else {
anv_ResetFences(anv_device_to_handle(queue->device),
1, &swapchain->fences[0]);
@@ -372,11 +376,14 @@ VkResult anv_QueuePresentKHR(
anv_QueueSubmit(_queue, 0, NULL, swapchain->fences[0]);
- result = swapchain->queue_present(swapchain,
- pPresentInfo->pImageIndices[i]);
+ item_result = swapchain->queue_present(swapchain,
+ pPresentInfo->pImageIndices[i]);
/* TODO: What if one of them returns OUT_OF_DATE? */
- if (result != VK_SUCCESS)
- return result;
+ if (pPresentInfo->pResults != NULL)
+ pPresentInfo->pResults[i] = item_result;
+ result = result == VK_SUCCESS ? item_result : result;
+ if (item_result != VK_SUCCESS)
+ continue;
VkFence last = swapchain->fences[2];
swapchain->fences[2] = swapchain->fences[1];